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>".$wpdb->postmeta."</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
- The topic ‘Existing Job Reference’ is closed to new replies.