Skip to content

Instantly share code, notes, and snippets.

@kish2011
Created February 20, 2017 11:57
Show Gist options
  • Save kish2011/5c2f5f1e0af8b0d3477bc93749a6d31a to your computer and use it in GitHub Desktop.
Save kish2011/5c2f5f1e0af8b0d3477bc93749a6d31a to your computer and use it in GitHub Desktop.
Add the Featured Company fields to the admin
/* Add the Featured Company fields to the admin */
add_filter( 'job_manager_job_listing_data_fields', 'admin_add_featured_company_field' );
function admin_add_featured_company_field( $fields ) {
global $post;
$current_user = wp_get_current_user();
if ( $current_user->has_cap( 'manage_job_listings' ) ) {
$fields['_company_featured'] = array(
'label' => __( 'Featured Company', 'wp-job-manager' ),
'type' => 'checkbox',
'description' => __( 'Featured Companies will be set, and can be styled differently.', 'wp-job-manager' ),
'priority' => 8
);
}
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment