Title: Existing Job Reference
Last modified: September 1, 2016

---

# Existing Job Reference

 *  [Jamie Gill](https://wordpress.org/support/users/patchgill/)
 * (@patchgill)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/existing-job-reference/)
 * Hi There,
 * Just a quick snippet if anyone else has this issue.
 * A client of mine has been using a feature in Broadbean where they can resend 
   an old job should it expire without any applicants, rather than delete and re-
   add as they lose the records/notes.
 * I have replaced the die refrence in inbox.php on line with the following :-
 *     ```
       global $wpdb;
       $meta = $wpdb->get_results("SELECT * FROM <code>&quot;.$wpdb->postmeta.&quot;</code> WHERE meta_key='_wpbb_job_reference' AND meta_value='".$wpdb->escape($wpbb_xml_params->job_reference)."'");
   
       date_default_timezone_set("Europe/London");
   
       $post_id = $meta[0]->post_id;
   
       // Update Published Date to make listing most recent
   
       $post_data = array(
           'ID'           => $post_id,
           'post_date'   => date('Y-m-d h:i:s'),
       );
   
       wp_update_post( $post_data );
   
       // Update Date Added custom field for client to work with Days to Advertise
   
       update_post_meta($post_id, '_wpbb_custom_date_added', date('Y-m-d'));
   
       echo apply_filters( 'wpbb_job_added_success_message', 'Success: Existing Job updated Ref '. $wpbb_xml_params->job_reference );
       ```
   
 * This gets the Post ID from the job reference and updates the Published date making
   it most recent and updates a custom broadbean field for date added.
 * Hope this helps others.
 * Cheers
    J
 * [https://wordpress.org/plugins/wpbroadbean/](https://wordpress.org/plugins/wpbroadbean/)

The topic ‘Existing Job Reference’ is closed to new replies.

 * ![](https://ps.w.org/wpbroadbean/assets/icon-256x256.png?rev=2046685)
 * [WP Broadbean](https://wordpress.org/plugins/wpbroadbean/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpbroadbean/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpbroadbean/)
 * [Active Topics](https://wordpress.org/support/plugin/wpbroadbean/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpbroadbean/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpbroadbean/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Jamie Gill](https://wordpress.org/support/users/patchgill/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/existing-job-reference/)
 * Status: not resolved