Skip to content

Instantly share code, notes, and snippets.

@tripflex
Created November 16, 2016 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/3085484b15e9a621e8b4b993a3e4f4bf to your computer and use it in GitHub Desktop.
Save tripflex/3085484b15e9a621e8b4b993a3e4f4bf to your computer and use it in GitHub Desktop.
Set a custom placeholder for WP Job Manager taxonomy dropdown field
<?php
add_filter( 'job_manager_term_select_field_wp_dropdown_categories_args', 'smyles_set_tax_dropdown_placeholder' );
function smyles_set_tax_dropdown_placeholder( $args ){
$taxonomy = $args['taxonomy'];
switch ($taxonomy){
// Set your custom taxonomy here
case 'mycustomtaxonomy':
// Set your custom taxonomy placeholder here
$args['show_option_none'] = __( 'Custom taxonomy placeholder 1' );
$args['option_none_value'] = '';
break;
case 'mycustomtaxonomy2':
$args['show_option_none'] = __( 'Custom taxonomy placeholder 2' );
$args['option_none_value'] = '';
break;
}
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment