Ticket #46925: 46925.6.diff
| File 46925.6.diff, 5.0 KB (added by , 7 years ago) |
|---|
-
src/wp-admin/includes/class-wp-debug-data.php
128 128 'fields' => array(), 129 129 ); 130 130 131 $info['wp-themes'] = array( 132 'label' => __( 'Other Themes' ), 131 $info['wp-parent-theme'] = array( 132 'label' => __( 'Parent Theme' ), 133 'fields' => array(), 134 ); 135 136 $info['wp-themes-inactive'] = array( 137 'label' => __( 'Inactive Themes' ), 133 138 'show_count' => true, 134 139 'fields' => array(), 135 140 ); … … 877 882 'name' => array( 878 883 'label' => __( 'Name' ), 879 884 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 880 'value' => $active_theme->Name, 885 'value' => sprintf( 886 // translators: 1: Parent theme name. 2: Parent theme slug. 887 __( '%1$s (%2$s)' ), 888 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 889 $active_theme->Name, 890 $active_theme->stylesheet 891 ), 881 892 ), 882 893 'version' => array( 883 894 'label' => __( 'Version' ), … … 896 907 ), 897 908 'parent_theme' => array( 898 909 'label' => __( 'Parent theme' ), 899 'value' => ( $active_theme->parent_theme ? $active_theme->parent_theme : __( 'None' ) ),900 'debug' => ( $active_theme->parent_theme ? $active_theme->parent_theme : 'none' ),910 'value' => ( $active_theme->parent_theme ? $active_theme->parent_theme . ' (' . $active_theme->template . ')' : __( 'None' ) ), 911 'debug' => ( $active_theme->parent_theme ? $active_theme->parent_theme . ' (' . $active_theme->template . ')' : 'none' ), 901 912 ), 902 913 'theme_features' => array( 903 914 'label' => __( 'Theme features' ), … … 905 916 ), 906 917 'theme_path' => array( 907 918 'label' => __( 'Theme directory location' ), 908 'value' => get_ template_directory(),919 'value' => get_stylesheet_directory(), 909 920 ), 910 921 ); 911 922 923 $parent_theme = $active_theme->parent(); 924 925 if ( $parent_theme ) { 926 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 927 $parent_theme_version = $parent_theme->Version; 928 $parent_theme_version_debug = $parent_theme_version; 929 930 if ( array_key_exists( $parent_theme->stylesheet, $theme_updates ) ) { 931 $parent_theme_update_new_version = $theme_updates[ $parent_theme->stylesheet ]->update['new_version']; 932 933 // translators: %s: Latest theme version number. 934 $parent_theme_version .= ' ' . sprintf( __( '(Latest version: %s)' ), $parent_theme_update_new_version ); 935 $parent_theme_version_debug .= sprintf( ' (latest version: %s)', $parent_theme_update_new_version ); 936 } 937 938 $parent_theme_author_uri = $parent_theme->offsetGet( 'Author URI' ); 939 940 $info['wp-parent-theme']['fields'] = array( 941 'name' => array( 942 'label' => __( 'Name' ), 943 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 944 'value' => sprintf( 945 // translators: 1: Parent theme name. 2: Parent theme slug. 946 __( '%1$s (%2$s)' ), 947 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 948 $parent_theme->Name, 949 $parent_theme->stylesheet 950 ), 951 ), 952 'version' => array( 953 'label' => __( 'Version' ), 954 'value' => $parent_theme_version, 955 'debug' => $parent_theme_version_debug, 956 ), 957 'author' => array( 958 'label' => __( 'Author' ), 959 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 960 'value' => wp_kses( $parent_theme->Author, array() ), 961 ), 962 'author_website' => array( 963 'label' => __( 'Author website' ), 964 'value' => ( $parent_theme_author_uri ? $parent_theme_author_uri : __( 'Undefined' ) ), 965 'debug' => ( $parent_theme_author_uri ? $parent_theme_author_uri : '(undefined)' ), 966 ), 967 'theme_path' => array( 968 'label' => __( 'Theme directory location' ), 969 'value' => get_template_directory(), 970 ), 971 ); 972 } 973 912 974 // Populate a list of all themes available in the install. 913 975 $all_themes = wp_get_themes(); 914 976 … … 917 979 if ( $active_theme->stylesheet === $theme_slug ) { 918 980 continue; 919 981 } 982 983 // Ignore the currently active parent theme from the list of all themes. 984 if ( ! empty( $parent_theme ) && $parent_theme->stylesheet === $theme_slug ) { 985 continue; 986 } 987 920 988 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 921 989 $theme_version = $theme->Version; 922 990 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase … … 953 1021 } 954 1022 955 1023 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 956 $info['wp-themes ']['fields'][ sanitize_text_field( $theme->Name ) ] = array(1024 $info['wp-themes-inactive']['fields'][ sanitize_text_field( $theme->Name ) ] = array( 957 1025 'label' => sprintf( 958 1026 // translators: 1: Theme name. 2: Theme slug. 959 1027 __( '%1$s (%2$s)' ),