Last active
June 1, 2021 12:37
-
-
Save pbearne/9039930c55487f860f5de971456d95c4 to your computer and use it in GitHub Desktop.
matador_variable_job_taxonomies example
This file contains hidden or 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
add_filter( 'matador_variable_job_taxonomies', function( $taxonomies ) { | |
$taxonomies['city'] = array( | |
'key' => 'city', | |
'single' => _x( 'City', 'Job City Singular Name.', 'matador-jobs' ), | |
'plural' => _x( 'Cities', 'Job Cities Plural Name.', 'matador-jobs' ), | |
// 'slug' => matador\Matador::setting( 'taxonomy_slug_cities' ) ?: 'matador-cities', // Add a slug in you wich to contoll slug otherwise the it will be set to matador-{slug} | |
// 'args' => array( // yu can add args to contol now the taxonomy is disaplied in the WP admin | |
// 'show_admin_column' => true, | |
// 'show_in_menu' => true, | |
// 'show_in_nav_menus' => true, | |
// ), | |
); | |
$taxonomies['state'] = array( | |
'key' => 'state', | |
'single' => _x( 'State', 'Job State Singular Name.', 'matador-jobs' ), | |
'plural' => _x( 'States', 'Job States Plural Name.', 'matador-jobs' ), | |
); | |
$taxonomies['country'] = array( | |
'key' => 'country', | |
'single' => _x( 'State', 'Job State Singular Name.', 'matador-jobs' ), | |
'plural' => _x( 'States', 'Job States Plural Name.', 'matador-jobs' ), | |
); | |
return $taxonomies; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment