Changeset 45680
- Timestamp:
- 07/26/2019 03:48:32 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-debug-data.php
r45399 r45680 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(), … … 874 879 $active_theme_author_uri = $active_theme->offsetGet( 'Author URI' ); 875 880 881 if ( $active_theme->parent_theme ) { 882 $active_theme_parent_theme = sprintf( 883 // translators: 1: Theme name. 2: Theme slug. 884 __( '%1$s (%2$s)' ), 885 $active_theme->parent_theme, 886 $active_theme->template 887 ); 888 $active_theme_parent_theme_debug = sprintf( 889 '%s (%s)', 890 $active_theme->parent_theme, 891 $active_theme->template 892 ); 893 } else { 894 $active_theme_parent_theme = __( 'None' ); 895 $active_theme_parent_theme_debug = 'none'; 896 } 897 876 898 $info['wp-active-theme']['fields'] = array( 877 899 'name' => array( 878 900 'label' => __( 'Name' ), 879 901 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 880 'value' => $active_theme->Name, 902 'value' => sprintf( 903 // translators: 1: Theme name. 2: Theme slug. 904 __( '%1$s (%2$s)' ), 905 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 906 $active_theme->Name, 907 $active_theme->stylesheet 908 ), 881 909 ), 882 910 'version' => array( … … 897 925 'parent_theme' => array( 898 926 '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' ),927 'value' => $active_theme_parent_theme, 928 'debug' => $active_theme_parent_theme_debug, 901 929 ), 902 930 'theme_features' => array( … … 906 934 'theme_path' => array( 907 935 'label' => __( 'Theme directory location' ), 908 'value' => get_ template_directory(),936 'value' => get_stylesheet_directory(), 909 937 ), 910 938 ); 939 940 $parent_theme = $active_theme->parent(); 941 942 if ( $parent_theme ) { 943 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 944 $parent_theme_version = $parent_theme->Version; 945 $parent_theme_version_debug = $parent_theme_version; 946 947 if ( array_key_exists( $parent_theme->stylesheet, $theme_updates ) ) { 948 $parent_theme_update_new_version = $theme_updates[ $parent_theme->stylesheet ]->update['new_version']; 949 950 // translators: %s: Latest theme version number. 951 $parent_theme_version .= ' ' . sprintf( __( '(Latest version: %s)' ), $parent_theme_update_new_version ); 952 $parent_theme_version_debug .= sprintf( ' (latest version: %s)', $parent_theme_update_new_version ); 953 } 954 955 $parent_theme_author_uri = $parent_theme->offsetGet( 'Author URI' ); 956 957 $info['wp-parent-theme']['fields'] = array( 958 'name' => array( 959 'label' => __( 'Name' ), 960 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 961 'value' => sprintf( 962 // translators: 1: Theme name. 2: Theme slug. 963 __( '%1$s (%2$s)' ), 964 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 965 $parent_theme->Name, 966 $parent_theme->stylesheet 967 ), 968 ), 969 'version' => array( 970 'label' => __( 'Version' ), 971 'value' => $parent_theme_version, 972 'debug' => $parent_theme_version_debug, 973 ), 974 'author' => array( 975 'label' => __( 'Author' ), 976 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 977 'value' => wp_kses( $parent_theme->Author, array() ), 978 ), 979 'author_website' => array( 980 'label' => __( 'Author website' ), 981 'value' => ( $parent_theme_author_uri ? $parent_theme_author_uri : __( 'Undefined' ) ), 982 'debug' => ( $parent_theme_author_uri ? $parent_theme_author_uri : '(undefined)' ), 983 ), 984 'theme_path' => array( 985 'label' => __( 'Theme directory location' ), 986 'value' => get_template_directory(), 987 ), 988 ); 989 } 911 990 912 991 // Populate a list of all themes available in the install. … … 914 993 915 994 foreach ( $all_themes as $theme_slug => $theme ) { 916 // Ignore the currently active theme from the list of all themes.995 // Exclude the currently active theme from the list of all themes. 917 996 if ( $active_theme->stylesheet === $theme_slug ) { 918 997 continue; 919 998 } 999 1000 // Exclude the currently active parent theme from the list of all themes. 1001 if ( ! empty( $parent_theme ) && $parent_theme->stylesheet === $theme_slug ) { 1002 continue; 1003 } 1004 920 1005 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 921 1006 $theme_version = $theme->Version; … … 954 1039 955 1040 // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 956 $info['wp-themes ']['fields'][ sanitize_text_field( $theme->Name ) ] = array(1041 $info['wp-themes-inactive']['fields'][ sanitize_text_field( $theme->Name ) ] = array( 957 1042 'label' => sprintf( 958 1043 // translators: 1: Theme name. 2: Theme slug.
Note: See TracChangeset
for help on using the changeset viewer.