Ticket #46925: 46925.4.diff
| File 46925.4.diff, 5.1 KB (added by , 7 years ago) |
|---|
-
src/wp-admin/includes/class-wp-debug-data.php
diff --git a/src/wp-admin/includes/class-wp-debug-data.php b/src/wp-admin/includes/class-wp-debug-data.php index fe7fe60fef..0fb6dd46f0 100644
a b class WP_Debug_Data { 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 ); … … class WP_Debug_Data { 873 878 'name' => array( 874 879 'label' => __( 'Name' ), 875 880 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 876 'value' => $active_theme->Name, 881 'value' => sprintf( 882 // translators: 1: Parent theme name. 2: Parent theme slug. 883 __( '%1$s (%2$s)' ), 884 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 885 $active_theme->Name, 886 $active_theme->stylesheet 887 ), 877 888 ), 878 889 'version' => array( 879 890 'label' => __( 'Version' ), … … class WP_Debug_Data { 892 903 ), 893 904 'parent_theme' => array( 894 905 'label' => __( 'Parent theme' ), 895 'value' => ( $active_theme->parent_theme ? $active_theme->parent_theme : __( 'None' ) ),896 'debug' => ( $active_theme->parent_theme ? $active_theme->parent_theme : 'none' ),906 'value' => ( $active_theme->parent_theme ? $active_theme->parent_theme . ' (' . $active_theme->template . ')' : __( 'None' ) ), 907 'debug' => ( $active_theme->parent_theme ? $active_theme->parent_theme . ' (' . $active_theme->template . ')' : 'none' ), 897 908 ), 898 909 'theme_features' => array( 899 910 'label' => __( 'Theme features' ), … … class WP_Debug_Data { 901 912 ), 902 913 'theme_path' => array( 903 914 'label' => __( 'Theme directory location' ), 904 'value' => get_ template_directory(),915 'value' => get_stylesheet_directory(), 905 916 ), 906 917 ); 907 918 919 $parent_theme = $active_theme->parent(); 920 921 if ( $parent_theme ) { 922 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 923 $parent_theme_version = $parent_theme->Version; 924 $parent_theme_version_debug = $parent_theme_version; 925 926 if ( array_key_exists( $parent_theme->stylesheet, $theme_updates ) ) { 927 $parent_theme_update_new_version = $theme_updates[ $parent_theme->stylesheet ]->update['new_version']; 928 929 // translators: %s: Latest theme version number. 930 $parent_theme_version .= ' ' . sprintf( __( '(Latest version: %s)' ), $parent_theme_update_new_version ); 931 $parent_theme_version_debug .= sprintf( ' (latest version: %s)', $parent_theme_update_new_version ); 932 } 933 934 $parent_theme_author_uri = $parent_theme->offsetGet( 'Author URI' ); 935 936 $info['wp-parent-theme']['fields'] = array( 937 'name' => array( 938 'label' => __( 'Name' ), 939 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 940 'value' => sprintf( 941 // translators: 1: Parent theme name. 2: Parent theme slug. 942 __( '%1$s (%2$s)' ), 943 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 944 $parent_theme->Name, 945 $parent_theme->stylesheet 946 ), 947 ), 948 'version' => array( 949 'label' => __( 'Version' ), 950 'value' => $parent_theme_version, 951 'debug' => $parent_theme_version_debug, 952 ), 953 'author' => array( 954 'label' => __( 'Author' ), 955 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 956 'value' => wp_kses( $parent_theme->Author, array() ), 957 ), 958 'author_website' => array( 959 'label' => __( 'Author website' ), 960 'value' => ( $parent_theme_author_uri ? $parent_theme_author_uri : __( 'Undefined' ) ), 961 'debug' => ( $parent_theme_author_uri ? $parent_theme_author_uri : '(undefined)' ), 962 ), 963 'theme_path' => array( 964 'label' => __( 'Theme directory location' ), 965 'value' => get_template_directory(), 966 ), 967 ); 968 } 969 908 970 // Populate a list of all themes available in the install. 909 971 $all_themes = wp_get_themes(); 910 972 911 973 foreach ( $all_themes as $theme_slug => $theme ) { 912 974 // Ignore the currently active theme from the list of all themes. 913 if ( $active_theme->stylesheet === $theme_slug ) { 975 if ( 976 $active_theme->stylesheet === $theme_slug || 977 ! empty( $parent_theme->stylesheet ) && $parent_theme->stylesheet === $theme_slug 978 ) { 914 979 continue; 915 980 } 916 981 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase … … class WP_Debug_Data { 949 1014 } 950 1015 951 1016 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 952 $info['wp-themes ']['fields'][ sanitize_text_field( $theme->Name ) ] = array(1017 $info['wp-themes-inactive']['fields'][ sanitize_text_field( $theme->Name ) ] = array( 953 1018 'label' => sprintf( 954 1019 // translators: 1: Theme name. 2: Theme slug. 955 1020 __( '%1$s (%2$s)' ),