Add phone field
-
Hi,
I am trying to add a phone number field.
I have followed instructions you listed within the support forums but all of them seem to be for adding a salary field. I have listed the below in my theme’s functions.php file
‘/* Add Custom Field to WP Admin Section */
add_filter( ‘job_manager_job_listing_data_fields’, ‘admin_add_job_phone_field’ );
function admin_add_job_phone_field( $fields ) {
$fields[‘_job_phone’] = array(
‘label’ => __( ‘Phone’, ‘job_manager’ ),
‘type’ => ‘text’,
‘placeholder’ => ”,
‘description’ => ”
);
return $fields;
}
add_action( ‘job_manager_update_job_data’, ‘admin_add_job_phone_field_save’, 10, 2 );
function admin_add_job_phone_field_save( $job_id, $values ) {
update_post_meta( $job_id, ‘_job_phone’, $values[‘job’][‘job_phone’] );
}
add_filter( ‘job_manager_job_listing_data_fields’, ‘admin_add_phone_field’ );
function admin_add_phone_field( $fields ) {
$fields[‘_job_phone’] = array(
‘label’ => __( ‘Phone’, ‘job_manager’ ),
‘type’ => ‘text’,
‘placeholder’ => ”,
‘description’ => ”
);
return $fields;
}’
Can you help me discover what I am doing wrong. The field shows up in admin but it doesn’t show in the site.
Thanks.
David.
- The topic ‘Add phone field’ is closed to new replies.