Created
December 23, 2016 17:44
-
-
Save tripflex/b888c405ecdfc39fe173904b916c8614 to your computer and use it in GitHub Desktop.
WP Job Manager execute custom code whenever featured listing is published (after payment, approval, or initial submission)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'publish_job_listing', 'smyles_featured_listing_do_something', 20, 2 ); | |
// This is executed whenever a Job Listing status is set to publish (after payment, approval, or initial submission) | |
// also executes when an expired job is relisted. | |
function smyles_featured_listing_do_something( $ID, $post ){ | |
$featured = get_post_meta( $ID, '_featured', true ); | |
if( ! empty( $featured ) { | |
// Listing is featured, execute some action, add your code below this line | |
// Add code to execute above this line | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment