Skip to content

Instantly share code, notes, and snippets.

@pbearne
Last active June 1, 2021 12:37
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 pbearne/9039930c55487f860f5de971456d95c4 to your computer and use it in GitHub Desktop.
Save pbearne/9039930c55487f860f5de971456d95c4 to your computer and use it in GitHub Desktop.
matador_variable_job_taxonomies example
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