Ticket #46925: 46925.3.diff
| File 46925.3.diff, 4.6 KB (added by , 7 years ago) |
|---|
-
src/wp-admin/includes/class-wp-debug-data.php
126 126 'fields' => array(), 127 127 ); 128 128 129 $info['wp-themes'] = array( 130 'label' => __( 'Other Themes' ), 129 $info['wp-parent-theme'] = array( 130 'label' => __( 'Parent Theme' ), 131 'fields' => array(), 132 ); 133 134 $info['wp-themes-inactive'] = array( 135 'label' => __( 'Inactive Themes' ), 131 136 'show_count' => true, 132 137 'fields' => array(), 133 138 ); … … 872 877 'name' => array( 873 878 'label' => __( 'Name' ), 874 879 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 875 'value' => $active_theme->Name, 880 'value' => sprintf( 881 // translators: 1: Parent theme name. 2: Parent theme slug. 882 __( '%1$s (%2$s)' ), 883 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 884 $active_theme->Name, 885 $active_theme->stylesheet 886 ), 876 887 ), 877 888 'version' => array( 878 889 'label' => __( 'Version' ), … … 891 902 ), 892 903 'parent_theme' => array( 893 904 'label' => __( 'Parent theme' ), 894 'value' => ( $active_theme->parent_theme ? $active_theme->parent_theme : __( 'None' ) ),895 'debug' => ( $active_theme->parent_theme ? $active_theme->parent_theme : 'none' ),905 'value' => ( $active_theme->parent_theme ? $active_theme->parent_theme . ' (' . $active_theme->template . ')' : __( 'None' ) ), 906 'debug' => ( $active_theme->parent_theme ? $active_theme->parent_theme . ' (' . $active_theme->template . ')' : 'none' ), 896 907 ), 897 908 'theme_features' => array( 898 909 'label' => __( 'Theme features' ), … … 900 911 ), 901 912 ); 902 913 914 $parent_theme = $active_theme->parent(); 915 916 if ( $parent_theme ) { 917 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 918 $parent_theme_version = $parent_theme->Version; 919 $parent_theme_version_debug = $parent_theme_version; 920 921 if ( array_key_exists( $parent_theme->stylesheet, $theme_updates ) ) { 922 $parent_theme_update_new_version = $theme_updates[ $parent_theme->stylesheet ]->update['new_version']; 923 924 // translators: %s: Latest theme version number. 925 $parent_theme_version .= ' ' . sprintf( __( '(Latest version: %s)' ), $parent_theme_update_new_version ); 926 $parent_theme_version_debug .= sprintf( ' (latest version: %s)', $parent_theme_update_new_version ); 927 } 928 929 $parent_theme_author_uri = $parent_theme->offsetGet( 'Author URI' ); 930 931 $info['wp-parent-theme']['fields'] = array( 932 'name' => array( 933 'label' => __( 'Name' ), 934 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 935 'value' => sprintf( 936 // translators: 1: Parent theme name. 2: Parent theme slug. 937 __( '%1$s (%2$s)' ), 938 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 939 $parent_theme->Name, 940 $parent_theme->stylesheet 941 ), 942 ), 943 'version' => array( 944 'label' => __( 'Version' ), 945 'value' => $parent_theme_version, 946 'debug' => $parent_theme_version_debug, 947 ), 948 'author' => array( 949 'label' => __( 'Author' ), 950 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 951 'value' => wp_kses( $parent_theme->Author, array() ), 952 ), 953 'author_website' => array( 954 'label' => __( 'Author website' ), 955 'value' => ( $parent_theme_author_uri ? $parent_theme_author_uri : __( 'Undefined' ) ), 956 'debug' => ( $parent_theme_author_uri ? $parent_theme_author_uri : '(undefined)' ), 957 ), 958 ); 959 } 960 903 961 // Populate a list of all themes available in the install. 904 962 $all_themes = wp_get_themes(); 905 963 906 964 foreach ( $all_themes as $theme_slug => $theme ) { 907 965 // Ignore the currently active theme from the list of all themes. 908 if ( $active_theme->stylesheet === $theme_slug ) {966 if ( $active_theme->stylesheet === $theme_slug || $parent_theme->stylesheet === $theme_slug ) { 909 967 continue; 910 968 } 911 969 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase … … 944 1002 } 945 1003 946 1004 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 947 $info['wp-themes ']['fields'][ sanitize_text_field( $theme->Name ) ] = array(1005 $info['wp-themes-inactive']['fields'][ sanitize_text_field( $theme->Name ) ] = array( 948 1006 'label' => sprintf( 949 1007 // translators: 1: Theme name. 2: Theme slug. 950 1008 __( '%1$s (%2$s)' ),