Ticket #26746: 26746.3.patch
File 26746.3.patch, 6.9 KB (added by , 7 years ago) |
---|
-
src/wp-includes/post.php
1506 1506 * @return object object with all the labels as member variables 1507 1507 */ 1508 1508 function get_post_type_labels( $post_type_object ) { 1509 $nohier_vs_hier_defaults = array( 1510 'name' => array( _x('Posts', 'post type general name'), _x('Pages', 'post type general name') ), 1511 'singular_name' => array( _x('Post', 'post type singular name'), _x('Page', 'post type singular name') ), 1512 'add_new' => array( _x('Add New', 'post'), _x('Add New', 'page') ), 1513 'add_new_item' => array( __('Add New Post'), __('Add New Page') ), 1514 'edit_item' => array( __('Edit Post'), __('Edit Page') ), 1515 'new_item' => array( __('New Post'), __('New Page') ), 1516 'view_item' => array( __('View Post'), __('View Page') ), 1517 'search_items' => array( __('Search Posts'), __('Search Pages') ), 1518 'not_found' => array( __('No posts found.'), __('No pages found.') ), 1519 'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ), 1520 'parent_item_colon' => array( null, __('Parent Page:') ), 1521 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ) 1522 ); 1523 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; 1509 static $nohier_vs_hier_defaults; 1524 1510 1511 if ( empty( $nohier_vs_hier_defaults ) || ! did_action( 'init' ) ) { 1512 $nohier_vs_hier_defaults = array( 1513 'name' => array( _x( 'Posts', 'post type general name' ), _x( 'Pages', 'post type general name' ) ), 1514 'singular_name' => array( _x( 'Post', 'post type singular name' ), _x( 'Page', 'post type singular name' ) ), 1515 'add_new' => array( _x( 'Add New', 'post' ), _x( 'Add New', 'page' ) ), 1516 'add_new_item' => array( __( 'Add New Post' ), __( 'Add New Page' ) ), 1517 'edit_item' => array( __( 'Edit Post' ), __( 'Edit Page' ) ), 1518 'new_item' => array( __( 'New Post' ), __( 'New Page' ) ), 1519 'view_item' => array( __( 'View Post' ), __( 'View Page' ) ), 1520 'search_items' => array( __( 'Search Posts' ), __( 'Search Pages' ) ), 1521 'not_found' => array( __( 'No posts found.' ), __( 'No pages found.' ) ), 1522 'not_found_in_trash' => array( __( 'No posts found in Trash.' ), __( 'No pages found in Trash.' ) ), 1523 'parent_item_colon' => array( null, __( 'Parent Page:' ) ), 1524 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ) 1525 ); 1526 1527 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; 1528 } 1529 1525 1530 $labels = _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults ); 1526 1531 1527 1532 $post_type = $post_type_object->name; -
src/wp-includes/taxonomy.php
461 461 */ 462 462 463 463 function get_taxonomy_labels( $tax ) { 464 static $nohier_vs_hier_defaults; 465 464 466 $tax->labels = (array) $tax->labels; 465 467 466 if ( isset( $tax->helps ) && empty( $tax->labels['separate_items_with_commas'] ) ) 468 if ( isset( $tax->helps ) && empty( $tax->labels['separate_items_with_commas'] ) ) { 467 469 $tax->labels['separate_items_with_commas'] = $tax->helps; 470 } 468 471 469 if ( isset( $tax->no_tagcloud ) && empty( $tax->labels['not_found'] ) ) 472 if ( isset( $tax->no_tagcloud ) && empty( $tax->labels['not_found'] ) ) { 470 473 $tax->labels['not_found'] = $tax->no_tagcloud; 474 } 471 475 472 $nohier_vs_hier_defaults = array(473 'name' => array( _x( 'Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ),474 'singular_name' => array( _x( 'Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singularname' ) ),475 'search_items' => array( __( 'Search Tags' ), __( 'Search Categories' ) ),476 'popular_items' => array( __( 'Popular Tags' ), null),477 'all_items' => array( __( 'All Tags' ), __( 'All Categories' )),478 'parent_item' => array( null, __( 'Parent Category' ) ),479 'parent_item_colon' => array( null, __( 'Parent Category:' ) ),480 'edit_item' => array( __( 'Edit Tag' ), __( 'Edit Category' ) ),481 'view_item' => array( __( 'View Tag' ), __( 'ViewCategory' ) ),482 'update_item' => array( __( 'Update Tag' ), __( 'UpdateCategory' ) ),483 'add_new_item' => array( __( 'Add New Tag' ), __( 'Add NewCategory' ) ),484 'new_item_name' => array( __( 'New Tag Name' ), __( 'New Category Name' ) ),485 'separate_items_with_commas' => array( __( 'Separate tags with commas' ), null),486 'add_or_remove_items' => array( __( 'Add or remove tags' ),null ),487 'choose_from_most_used' => array( __( 'Choose from the most used tags' ),null ),488 'not_found' => array( __( 'No tags found.' ), null ),489 );490 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];476 if ( empty( $nohier_vs_hier_defaults ) || ! did_action( 'init' ) ) { 477 $nohier_vs_hier_defaults = array( 478 'name' => array( _x( 'Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ), 479 'singular_name' => array( _x( 'Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singular name' ) ), 480 'search_items' => array( __( 'Search Tags' ), __( 'Search Categories' ) ), 481 'popular_items' => array( __( 'Popular Tags' ), null ), 482 'all_items' => array( __( 'All Tags' ), __( 'All Categories' ) ), 483 'parent_item' => array( null, __( 'Parent Category' ) ), 484 'parent_item_colon' => array( null, __( 'Parent Category:' ) ), 485 'edit_item' => array( __( 'Edit Tag' ), __( 'Edit Category' ) ), 486 'view_item' => array( __( 'View Tag' ), __( 'View Category' ) ), 487 'update_item' => array( __( 'Update Tag' ), __( 'Update Category' ) ), 488 'add_new_item' => array( __( 'Add New Tag' ), __( 'Add New Category' ) ), 489 'new_item_name' => array( __( 'New Tag Name' ), __( 'New Category Name' ) ), 490 'separate_items_with_commas' => array( __( 'Separate tags with commas' ), null ), 491 'add_or_remove_items' => array( __( 'Add or remove tags' ), null ), 492 'choose_from_most_used' => array( __( 'Choose from the most used tags' ), null ), 493 'not_found' => array( __( 'No tags found.' ), null ), 494 ); 491 495 496 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; 497 } 498 492 499 return _get_custom_object_labels( $tax, $nohier_vs_hier_defaults ); 493 500 } 494 501