@@ -1172,95 +1172,91 @@ private static function get_wp_parent_theme(): array {
11721172
11731173 $ active_theme = wp_get_theme ();
11741174 $ parent_theme = $ active_theme ->parent ();
1175+ $ fields = array ();
11751176
1176- if ( ! $ parent_theme ) {
1177- return array (
1178- 'label ' => __ ( 'Parent Theme ' ),
1179- 'fields ' => array (),
1180- );
1181- }
1182-
1183- $ parent_theme_version = $ parent_theme ->version ;
1184- $ parent_theme_version_debug = $ parent_theme_version ;
1177+ if ( $ parent_theme ) {
1178+ $ parent_theme_version = $ parent_theme ->version ;
1179+ $ parent_theme_version_debug = $ parent_theme_version ;
11851180
1186- if ( array_key_exists ( $ parent_theme ->stylesheet , $ theme_updates ) ) {
1187- $ parent_theme_update_new_version = $ theme_updates [ $ parent_theme ->stylesheet ]->update ['new_version ' ];
1181+ if ( array_key_exists ( $ parent_theme ->stylesheet , $ theme_updates ) ) {
1182+ $ parent_theme_update_new_version = $ theme_updates [ $ parent_theme ->stylesheet ]->update ['new_version ' ];
11881183
1189- /* translators: %s: Latest theme version number. */
1190- $ parent_theme_version .= ' ' . sprintf ( __ ( '(Latest version: %s) ' ), $ parent_theme_update_new_version );
1191- $ parent_theme_version_debug .= sprintf ( ' (latest version: %s) ' , $ parent_theme_update_new_version );
1192- }
1193-
1194- $ parent_theme_author_uri = $ parent_theme ->display ( 'AuthorURI ' );
1184+ /* translators: %s: Latest theme version number. */
1185+ $ parent_theme_version .= ' ' . sprintf ( __ ( '(Latest version: %s) ' ), $ parent_theme_update_new_version );
1186+ $ parent_theme_version_debug .= sprintf ( ' (latest version: %s) ' , $ parent_theme_update_new_version );
1187+ }
11951188
1196- $ fields = array (
1197- 'name ' => array (
1198- 'label ' => __ ( 'Name ' ),
1199- 'value ' => sprintf (
1200- /* translators: 1: Theme name. 2: Theme slug. */
1201- __ ( '%1$s (%2$s) ' ),
1202- $ parent_theme ->name ,
1203- $ parent_theme ->stylesheet
1189+ $ parent_theme_author_uri = $ parent_theme ->display ( 'AuthorURI ' );
1190+
1191+ $ fields = array (
1192+ 'name ' => array (
1193+ 'label ' => __ ( 'Name ' ),
1194+ 'value ' => sprintf (
1195+ /* translators: 1: Theme name. 2: Theme slug. */
1196+ __ ( '%1$s (%2$s) ' ),
1197+ $ parent_theme ->name ,
1198+ $ parent_theme ->stylesheet
1199+ ),
12041200 ),
1205- ),
1206- 'version ' => array (
1207- 'label ' => __ ( 'Version ' ),
1208- 'value ' => $ parent_theme_version ,
1209- 'debug ' => $ parent_theme_version_debug ,
1210- ),
1211- 'author ' => array (
1212- 'label ' => __ ( 'Author ' ),
1213- 'value ' => wp_kses ( $ parent_theme ->author , array () ),
1214- ),
1215- 'author_website ' => array (
1216- 'label ' => __ ( 'Author website ' ),
1217- 'value ' => ( $ parent_theme_author_uri ? $ parent_theme_author_uri : __ ( 'Undefined ' ) ),
1218- 'debug ' => ( $ parent_theme_author_uri ? $ parent_theme_author_uri : '(undefined) ' ),
1219- ),
1220- 'theme_path ' => array (
1221- 'label ' => __ ( 'Theme directory location ' ),
1222- 'value ' => get_template_directory (),
1223- ),
1224- );
1201+ 'version ' => array (
1202+ 'label ' => __ ( 'Version ' ),
1203+ 'value ' => $ parent_theme_version ,
1204+ 'debug ' => $ parent_theme_version_debug ,
1205+ ),
1206+ 'author ' => array (
1207+ 'label ' => __ ( 'Author ' ),
1208+ 'value ' => wp_kses ( $ parent_theme ->author , array () ),
1209+ ),
1210+ 'author_website ' => array (
1211+ 'label ' => __ ( 'Author website ' ),
1212+ 'value ' => ( $ parent_theme_author_uri ? $ parent_theme_author_uri : __ ( 'Undefined ' ) ),
1213+ 'debug ' => ( $ parent_theme_author_uri ? $ parent_theme_author_uri : '(undefined) ' ),
1214+ ),
1215+ 'theme_path ' => array (
1216+ 'label ' => __ ( 'Theme directory location ' ),
1217+ 'value ' => get_template_directory (),
1218+ ),
1219+ );
12251220
1226- if ( $ auto_updates_enabled ) {
1227- if ( isset ( $ transient ->response [ $ parent_theme ->stylesheet ] ) ) {
1228- $ item = $ transient ->response [ $ parent_theme ->stylesheet ];
1229- } elseif ( isset ( $ transient ->no_update [ $ parent_theme ->stylesheet ] ) ) {
1230- $ item = $ transient ->no_update [ $ parent_theme ->stylesheet ];
1231- } else {
1232- $ item = array (
1233- 'theme ' => $ parent_theme ->stylesheet ,
1234- 'new_version ' => $ parent_theme ->version ,
1235- 'url ' => '' ,
1236- 'package ' => '' ,
1237- 'requires ' => '' ,
1238- 'requires_php ' => '' ,
1239- );
1240- }
1221+ if ( $ auto_updates_enabled ) {
1222+ if ( isset ( $ transient ->response [ $ parent_theme ->stylesheet ] ) ) {
1223+ $ item = $ transient ->response [ $ parent_theme ->stylesheet ];
1224+ } elseif ( isset ( $ transient ->no_update [ $ parent_theme ->stylesheet ] ) ) {
1225+ $ item = $ transient ->no_update [ $ parent_theme ->stylesheet ];
1226+ } else {
1227+ $ item = array (
1228+ 'theme ' => $ parent_theme ->stylesheet ,
1229+ 'new_version ' => $ parent_theme ->version ,
1230+ 'url ' => '' ,
1231+ 'package ' => '' ,
1232+ 'requires ' => '' ,
1233+ 'requires_php ' => '' ,
1234+ );
1235+ }
12411236
1242- $ auto_update_forced = wp_is_auto_update_forced_for_item ( 'theme ' , null , (object ) $ item );
1237+ $ auto_update_forced = wp_is_auto_update_forced_for_item ( 'theme ' , null , (object ) $ item );
12431238
1244- if ( ! is_null ( $ auto_update_forced ) ) {
1245- $ enabled = $ auto_update_forced ;
1246- } else {
1247- $ enabled = in_array ( $ parent_theme ->stylesheet , $ auto_updates , true );
1248- }
1239+ if ( ! is_null ( $ auto_update_forced ) ) {
1240+ $ enabled = $ auto_update_forced ;
1241+ } else {
1242+ $ enabled = in_array ( $ parent_theme ->stylesheet , $ auto_updates , true );
1243+ }
12491244
1250- if ( $ enabled ) {
1251- $ parent_theme_auto_update_string = __ ( 'Enabled ' );
1252- } else {
1253- $ parent_theme_auto_update_string = __ ( 'Disabled ' );
1254- }
1245+ if ( $ enabled ) {
1246+ $ parent_theme_auto_update_string = __ ( 'Enabled ' );
1247+ } else {
1248+ $ parent_theme_auto_update_string = __ ( 'Disabled ' );
1249+ }
12551250
1256- /** This filter is documented in wp-admin/includes/class-wp-debug-data.php */
1257- $ parent_theme_auto_update_string = apply_filters ( 'theme_auto_update_debug_string ' , $ parent_theme_auto_update_string , $ parent_theme , $ enabled );
1251+ /** This filter is documented in wp-admin/includes/class-wp-debug-data.php */
1252+ $ parent_theme_auto_update_string = apply_filters ( 'theme_auto_update_debug_string ' , $ parent_theme_auto_update_string , $ parent_theme , $ enabled );
12581253
1259- $ fields ['auto_update ' ] = array (
1260- 'label ' => __ ( 'Auto-update ' ),
1261- 'value ' => $ parent_theme_auto_update_string ,
1262- 'debug ' => $ parent_theme_auto_update_string ,
1263- );
1254+ $ fields ['auto_update ' ] = array (
1255+ 'label ' => __ ( 'Auto-update ' ),
1256+ 'value ' => $ parent_theme_auto_update_string ,
1257+ 'debug ' => $ parent_theme_auto_update_string ,
1258+ );
1259+ }
12641260 }
12651261
12661262 return array (
0 commit comments