Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. add_action( 'init', function() {
  2. if ( empty( $_GET['bulk-assign-type'] ) || ! current_user_can( 'administrator' ) ) {
  3. return;
  4. }
  5.  
  6. $listing_type = 'event'; // modify this
  7. $listings = (array) get_posts( [
  8. 'post_type' => 'job_listing',
  9. 'posts_per_page' => -1,
  10. 'post_status' => 'any',
  11. ] );
  12.  
  13. foreach ( $listings as $listing ) {
  14. update_post_meta( $listing->ID, '_case27_listing_type', $listing_type );
  15. }
  16. } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement