Widgets: Make the categories widget work with custom taxonomies.

Props fonglh, wonderboymusic, DrewAPicture, kucrut.
Fixes #21165.

Built from https://develop.svn.wordpress.org/trunk@34376


git-svn-id: http://core.svn.wordpress.org/trunk@34340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor
2015-09-22 04:25:24 +00:00
parent c60b00fc20
commit 40c15af795
3 changed files with 41 additions and 3 deletions

View File

@@ -459,6 +459,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
*
* - name - general name for the taxonomy, usually plural. The same as and overridden by $tax->label. Default is Tags/Categories
* - singular_name - name for one object of this taxonomy. Default is Tag/Category
* - select_name - prompt to select a taxonomy when using a dropdown list in the Categories widget. Default is 'Select Category'.
* - search_items - Default is Search Tags/Search Categories
* - popular_items - This string isn't used on hierarchical taxonomies. Default is Popular Tags
* - all_items - Default is All Tags/All Categories
@@ -497,6 +498,7 @@ function get_taxonomy_labels( $tax ) {
$nohier_vs_hier_defaults = array(
'name' => array( _x( 'Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ),
'singular_name' => array( _x( 'Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singular name' ) ),
'select_name' => array( null, __( 'Select Category' ) ),
'search_items' => array( __( 'Search Tags' ), __( 'Search Categories' ) ),
'popular_items' => array( __( 'Popular Tags' ), null ),
'all_items' => array( __( 'All Tags' ), __( 'All Categories' ) ),