Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author BlueGlass

    (@blueglassinteractive)

    @jeyluk

    Something like this should do the trick, add to your themes function.php and edit accordingly to your needs:

    add_filter( 'jobs/preview_custom_message', function($custom_message, $post_id){
    	// Get unix timestamp
    	$today = date_i18n('U'); 
    
    	// Get valid through dane and convert it to timestamp
    	$valid_through = get_post_meta($post_id, 'position_valid_through', true);
    	$valid_through_timestamp = strtotime($valid_through);
    	
    	if( $valid_through_timestamp > $today ){
    		$custom_message = 'Closed';
    	}else{
    		$custom_message = 'Open';
    	}
    
        return $custom_message;
    }, 10, 2 );

    Br!

    • This reply was modified 4 years, 9 months ago by BlueGlass.
    Thread Starter jeyluk

    (@jeyluk)

    it works!

    Thank you.

    Great professional and nice plugin

    • This reply was modified 4 years, 9 months ago by jeyluk.
    Mike

    (@techiebazaar)

    I have the following code on the page to list the vacancies:
    [job-postings show_filters=”false” hide_past=”true” order “ASC” orderby=”valid_through” posts_per_page=”10″]

    Could you please advise can I modify the above code to include the following syntax?

    add_filter( ‘jobs/listing_query’, function($args){
    $args[‘meta_key’] = ‘position_valid_through’;
    $args[‘orderby’] = ‘meta_value’;
    return $args;
    } );

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘job custom message and Valid Through’ is closed to new replies.