Created
November 16, 2016 20:48
-
-
Save tripflex/3085484b15e9a621e8b4b993a3e4f4bf to your computer and use it in GitHub Desktop.
Set a custom placeholder for WP Job Manager taxonomy dropdown field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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