WordPress.org

Make WordPress Core

Ticket #9647: 9647_1.diff

File 9647_1.diff, 3.6 KB (added by arena, 9 years ago)
  • wp-admin/edit-form-advanced.php

     
    293293foreach ( get_object_taxonomies('post') as $tax_name ) {
    294294        if ( !is_taxonomy_hierarchical($tax_name) ) {
    295295                $taxonomy = get_taxonomy($tax_name);
    296                 $label = isset($taxonomy->label) ? attribute_escape($taxonomy->label) : $tax_name;
     296                $label = isset($taxonomy->label) ? attribute_escape(__($taxonomy->label)) : $tax_name;
    297297
    298298                add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', 'post', 'side', 'core');
    299299        }
  • wp-admin/menu.php

     
    3939                if ( $tax->hierarchical || ! in_array('post', (array) $tax->object_type, true) )
    4040                        continue;
    4141
    42                 $submenu['edit.php'][$i] = array( attribute_escape($tax->label), 'manage_categories', 'edit-tags.php?taxonomy=' . $tax->name );
     42                $submenu['edit.php'][$i] = array( attribute_escape(__($tax->label)), 'manage_categories', 'edit-tags.php?taxonomy=' . $tax->name );
    4343                ++$i;
    4444        }
    4545
  • wp-includes/taxonomy.php

     
    77 * @since 2.3.0
    88 */
    99
    10 //
    11 // Taxonomy Registration
    12 //
    13 
    1410/**
    15  * Default Taxonomy Objects
    16  * @since 2.3.0
    17  * @global array $wp_taxonomies
    18  */
    19 $wp_taxonomies = array();
    20 
    21 function create_initial_taxonomies() {
    22         global $wp_taxonomies;
    23         $wp_taxonomies['category'] = (object) array('name' => 'category', 'object_type' => 'post', 'hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories'));
    24         $wp_taxonomies['post_tag'] = (object) array('name' => 'post_tag', 'object_type' => 'post', 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags'));
    25         $wp_taxonomies['link_category'] = (object) array('name' => 'link_category', 'object_type' => 'link', 'hierarchical' => false);
    26 
    27 }
    28 add_action( 'init', 'create_initial_taxonomies' );
    29 
    30 /**
    3111 * Return all of the taxonomy names that are of $object_type.
    3212 *
    3313 * It appears that this function can be used to find all of the names inside of
     
    173153function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
    174154        global $wp_taxonomies, $wp_rewrite, $wp;
    175155
     156        if (!is_array($wp_taxonomies))
     157                $wp_taxonomies = array();
     158
    176159        $defaults = array('hierarchical' => false, 'update_count_callback' => '', 'rewrite' => true, 'query_var' => true);
    177160        $args = wp_parse_args($args, $defaults);
    178161
     
    23322315
    23332316        return false;
    23342317}
    2335 
    23362318?>
  • wp-settings.php

     
    351351require (ABSPATH . WPINC . '/http.php');
    352352require (ABSPATH . WPINC . '/widgets.php');
    353353
     354//
     355// Taxonomy Registration
     356//
     357register_taxonomy( 'category', 'post', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories')) ) ;
     358register_taxonomy( 'post_tag', 'post', array('hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags')) ) ;
     359register_taxonomy( 'link_category', 'link', array('hierarchical' => false) ) ;
     360
    354361if ( !defined('WP_CONTENT_URL') )
    355362        define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
    356363