• Resolved ahmed

    (@themepi)


    Hi, I need the option to make job expiry date optional. For some job, there is no expiry date mentioned by job publisher. In that case, I would like to say: Job expiration date not mentioned or keep it blank.

    I appreciate the help.

    Thanks

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Adam Heckler

    (@adamkheckler)

    I don’t currently see a job expiration field on your submit job form here:

    https://minervajobs.co.uk/submit-job-form/

    That means that, by default, jobs will expire after the number of days you have configured here:

    https://d.pr/i/BjpL50

    (That’s under Job Listings > Settings > Job Submission tab.)

    If you leave that field blank, jobs will never expire.

    Does that answer your question? Let me know if not. ??

    Thanks!

    Thread Starter ahmed

    (@themepi)

    Thanks for your reply. ??
    Jobs are manually added from wp-admin panel.

    https://minervajobs.co.uk/job/data-scientist-4/
    I am getting the job expiry date using some php code and displayed on site.
    Example: Deadline: February 1, 2018

    add_action( 'single_job_listing_meta_end', 'display_job_expire_date' );
    function display_job_expire_date() {
      global $post;
    
      $expiration_date = get_post_meta( $post->ID, '_job_expires', true );
      
    $new_date_format= date("F j, Y", strtotime($expiration_date)); 
      if ( $new_date_format ) {
    	  
        echo '<li style="color:#ff4b4b;" class="date-posted"  >' . __( 'Deadline:' ) .' '. esc_html( $new_date_format) . '</li>';
      }

    If I leave the field Job expiry date blank it shows a date month/day/1970 (may be any default date).
    How can I show date not mentioned.

    Thanks

    Plugin Contributor Adam Heckler

    (@adamkheckler)

    Jobs are manually added from wp-admin panel.

    I would strongly advise against this. WP Job Manager is designed such that almost everything can and should be done via the frontend forms: adding jobs, editing jobs, marking as filled, etc.

    Anyway, to the issue…

    If I leave the field Job expiry date blank it shows a date month/day/1970 (may be any default date).

    Right after you define $expiration_date but before you define $new_date_format, I would put in a check to see if the result of get_post_meta() is empty/false. This is because, if expiration dates are optional, not all posts will have them, and strtotime may return January 1 1970 00:00:00 UTC in such a case.

    I’m not super skilled with PHP however, so you may want to look into one of these services for help with your custom code:

    https://codeable.io/?ref=l1TwZ

    https://studio.envato.com/

    https://jobs.wordpress.net/

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can i make job expiry date optional?’ is closed to new replies.