Changeset 47835 for trunk/src/wp-admin/includes/class-wp-debug-data.php
- Timestamp:
- 05/20/2020 06:47:24 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-debug-data.php
r47762 r47835 859 859 $plugins = get_plugins(); 860 860 $plugin_updates = get_plugin_updates(); 861 $auto_updates = array(); 862 863 $auto_updates_enabled = wp_is_auto_update_enabled_for_type( 'plugin' ); 864 $auto_updates_enabled_str = __( 'Auto-updates enabled' ); 865 $auto_updates_disabled_str = __( 'Auto-updates disabled' ); 866 867 if ( $auto_updates_enabled ) { 868 $auto_updates = (array) get_site_option( 'auto_update_plugins', array() ); 869 } 861 870 862 871 foreach ( $plugins as $plugin_path => $plugin ) { … … 893 902 } 894 903 904 if ( $auto_updates_enabled ) { 905 if ( in_array( $plugin_path, $auto_updates, true ) ) { 906 $plugin_version_string .= ' | ' . $auto_updates_enabled_str; 907 $plugin_version_string_debug .= ', ' . $auto_updates_enabled_str; 908 } else { 909 $plugin_version_string .= ' | ' . $auto_updates_disabled_str; 910 $plugin_version_string_debug .= ', ' . $auto_updates_disabled_str; 911 } 912 } 913 895 914 $info[ $plugin_part ]['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array( 896 915 'label' => $plugin['Name'], … … 915 934 $active_theme_version = $active_theme->version; 916 935 $active_theme_version_debug = $active_theme_version; 936 937 $auto_updates = array(); 938 $auto_updates_enabled = wp_is_auto_update_enabled_for_type( 'theme' ); 939 if ( $auto_updates_enabled ) { 940 $auto_updates = (array) get_site_option( 'auto_update_themes', array() ); 941 } 917 942 918 943 if ( array_key_exists( $active_theme->stylesheet, $theme_updates ) ) { … … 981 1006 ), 982 1007 ); 983 1008 if ( $auto_updates_enabled ) { 1009 if ( in_array( $active_theme->stylesheet, $auto_updates ) ) { 1010 $theme_auto_update_string = __( 'Enabled' ); 1011 } else { 1012 $theme_auto_update_string = __( 'Disabled' ); 1013 } 1014 1015 $info['wp-active-theme']['fields']['auto_update'] = array( 1016 'label' => __( 'Auto-update' ), 1017 'value' => $theme_auto_update_string, 1018 'debug' => $theme_auto_update_string, 1019 ); 1020 } 984 1021 $parent_theme = $active_theme->parent(); 985 1022 … … 1027 1064 ), 1028 1065 ); 1066 if ( $auto_updates_enabled ) { 1067 if ( in_array( $parent_theme->stylesheet, $auto_updates ) ) { 1068 $parent_theme_auto_update_string = __( 'Enabled' ); 1069 } else { 1070 $parent_theme_auto_update_string = __( 'Disabled' ); 1071 } 1072 1073 $info['wp-parent-theme']['fields']['auto_update'] = array( 1074 'label' => __( 'Auto-update' ), 1075 'value' => $parent_theme_auto_update_string, 1076 'debug' => $parent_theme_auto_update_string, 1077 ); 1078 } 1029 1079 } 1030 1080 … … 1074 1124 $theme_version_string .= ' ' . sprintf( __( '(Latest version: %s)' ), $theme_updates[ $theme_slug ]->update['new_version'] ); 1075 1125 $theme_version_string_debug .= sprintf( ' (latest version: %s)', $theme_updates[ $theme_slug ]->update['new_version'] ); 1126 } 1127 1128 if ( $auto_updates_enabled ) { 1129 if ( in_array( $theme_slug, $auto_updates ) ) { 1130 $theme_version_string .= ' | ' . $auto_updates_enabled_str; 1131 $theme_version_string_debug .= ',' . $auto_updates_enabled_str; 1132 } else { 1133 $theme_version_string .= ' | ' . $auto_updates_disabled_str; 1134 $theme_version_string_debug .= ', ' . $auto_updates_disabled_str; 1135 } 1076 1136 } 1077 1137
Note: See TracChangeset
for help on using the changeset viewer.