3rd-party.php
3 years ago
all-in-one-seo-pack.php
2 years ago
jetpack.php
5 days ago
polylang.php
2 years ago
rp4wp.php
2 years ago
wp-all-import.php
2 years ago
wpcom.php
2 years ago
wpml.php
2 months ago
yoast.php
5 days ago
wp-all-import.php
26 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Adds additional compatibility with WP All Import. |
| 4 | * |
| 5 | * @package wp-job-manager |
| 6 | */ |
| 7 | |
| 8 | add_action( 'pmxi_saved_post', 'wpjm_pmxi_saved_post', 10, 1 ); |
| 9 | |
| 10 | /** |
| 11 | * After importing via WP All Import, adds default meta data. |
| 12 | * |
| 13 | * @param int $post_id |
| 14 | */ |
| 15 | function wpjm_pmxi_saved_post( $post_id ) { |
| 16 | if ( \WP_Job_Manager_Post_Types::PT_LISTING === get_post_type( $post_id ) ) { |
| 17 | WP_Job_Manager_Post_Types::instance()->maybe_add_default_meta_data( $post_id, get_post( $post_id ) ); |
| 18 | if ( ! WP_Job_Manager_Geocode::has_location_data( $post_id ) ) { |
| 19 | $location = get_post_meta( $post_id, '_job_location', true ); |
| 20 | if ( $location ) { |
| 21 | WP_Job_Manager_Geocode::generate_location_data( $post_id, $location ); |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 |