| | 908 | $parent_theme = $active_theme->parent(); |
| | 909 | |
| | 910 | if ( $parent_theme ) { |
| | 911 | // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase |
| | 912 | $parent_theme_version = $parent_theme->Version; |
| | 913 | $parent_theme_version_debug = $parent_theme_version; |
| | 914 | |
| | 915 | if ( array_key_exists( $parent_theme->stylesheet, $theme_updates ) ) { |
| | 916 | $parent_theme_update_new_version = $theme_updates[ $parent_theme->stylesheet ]->update['new_version']; |
| | 917 | |
| | 918 | // translators: %s: Latest theme version number. |
| | 919 | $parent_theme_version .= ' ' . sprintf( __( '(Latest version: %s)' ), $parent_theme_update_new_version ); |
| | 920 | $parent_theme_version_debug .= sprintf( ' (latest version: %s)', $parent_theme_update_new_version ); |
| | 921 | } |
| | 922 | |
| | 923 | $parent_theme_author_uri = $parent_theme->offsetGet( 'Author URI' ); |
| | 924 | |
| | 925 | $info['wp-parent-theme']['fields'] = array( |
| | 926 | 'name' => array( |
| | 927 | 'label' => __( 'Name' ), |
| | 928 | // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase |
| | 929 | 'value' => $parent_theme->Name, |
| | 930 | ), |
| | 931 | 'version' => array( |
| | 932 | 'label' => __( 'Version' ), |
| | 933 | 'value' => $parent_theme_version, |
| | 934 | 'debug' => $parent_theme_version_debug, |
| | 935 | ), |
| | 936 | 'author' => array( |
| | 937 | 'label' => __( 'Author' ), |
| | 938 | // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase |
| | 939 | 'value' => wp_kses( $parent_theme->Author, array() ), |
| | 940 | ), |
| | 941 | 'author_website' => array( |
| | 942 | 'label' => __( 'Author website' ), |
| | 943 | 'value' => ( $parent_theme_author_uri ? $parent_theme_author_uri : __( 'Undefined' ) ), |
| | 944 | 'debug' => ( $parent_theme_author_uri ? $parent_theme_author_uri : '(undefined)' ), |
| | 945 | ), |
| | 946 | ); |
| | 947 | } |
| | 948 | |