クラス WP_Theme::translate_header()
2014/12/17
WP_Theme::translate_header()
WP_Theme::定義ファイル : /blog/wp-includes/class-wp-theme.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | private function translate_header( $header, $value ) { switch ( $header ) { case 'Name' : // Cached for sorting reasons. if ( isset( $this->name_translated ) ) return $this->name_translated; $this->name_translated = translate( $value, $this->get('TextDomain' ) ); return $this->name_translated; case 'Tags' : if ( empty( $value ) || ! function_exists( 'get_theme_feature_list' ) ) return $value; static $tags_list; if ( ! isset( $tags_list ) ) { $tags_list = array(); $feature_list = get_theme_feature_list( false ); // No API foreach ( $feature_list as $tags ) $tags_list += $tags; } foreach ( $value as &$tag ) { if ( isset( $tags_list[ $tag ] ) ) { $tag = $tags_list[ $tag ]; } elseif ( isset( self::$tag_map[ $tag ] ) ) { $tag = $tags_list[ self::$tag_map[ $tag ] ]; } } return $value; default : $value = translate( $value, $this->get('TextDomain') ); } return $value; } |