Skip to content

Instantly share code, notes, and snippets.

@tripflex
Created December 23, 2016 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tripflex/b888c405ecdfc39fe173904b916c8614 to your computer and use it in GitHub Desktop.
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)
<?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