Changeset 35551
- Timestamp:
- 11/06/2015 12:40:09 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/class-wp-upgrader.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r35170 r35551 1650 1650 1651 1651 // A proper archive should have a style.css file in the single subdirectory 1652 if ( ! file_exists( $working_directory . 'style.css' ) ) 1653 return new WP_Error( 'incompatible_archive_theme_no_style', $this->strings['incompatible_archive'], __( 'The theme is missing the <code>style.css</code> stylesheet.' ) ); 1652 if ( ! file_exists( $working_directory . 'style.css' ) ) { 1653 return new WP_Error( 'incompatible_archive_theme_no_style', $this->strings['incompatible_archive'], 1654 /* translators: %s: style.css */ 1655 sprintf( __( 'The theme is missing the %s stylesheet.' ), 1656 '<code>style.css</code>' 1657 ) 1658 ); 1659 } 1654 1660 1655 1661 $info = get_file_data( $working_directory . 'style.css', array( 'Name' => 'Theme Name', 'Template' => 'Template' ) ); 1656 1662 1657 if ( empty( $info['Name'] ) ) 1658 return new WP_Error( 'incompatible_archive_theme_no_name', $this->strings['incompatible_archive'], __( "The <code>style.css</code> stylesheet doesn't contain a valid theme header." ) ); 1663 if ( empty( $info['Name'] ) ) { 1664 return new WP_Error( 'incompatible_archive_theme_no_name', $this->strings['incompatible_archive'], 1665 /* translators: %s: style.css */ 1666 sprintf( __( 'The %s stylesheet doesn’t contain a valid theme header.' ), 1667 '<code>style.css</code>' 1668 ) 1669 ); 1670 } 1659 1671 1660 1672 // If it's not a child theme, it must have at least an index.php to be legit. 1661 if ( empty( $info['Template'] ) && ! file_exists( $working_directory . 'index.php' ) ) 1662 return new WP_Error( 'incompatible_archive_theme_no_index', $this->strings['incompatible_archive'], __( 'The theme is missing the <code>index.php</code> file.' ) ); 1673 if ( empty( $info['Template'] ) && ! file_exists( $working_directory . 'index.php' ) ) { 1674 return new WP_Error( 'incompatible_archive_theme_no_index', $this->strings['incompatible_archive'], 1675 /* translators: %s: index.php */ 1676 sprintf( __( 'The theme is missing the %s file.' ), 1677 '<code>index.php</code>' 1678 ) 1679 ); 1680 } 1663 1681 1664 1682 return $source; … … 2085 2103 } 2086 2104 2087 if ( ! $mo || ! $po ) 2105 if ( ! $mo || ! $po ) { 2088 2106 return new WP_Error( 'incompatible_archive_pomo', $this->strings['incompatible_archive'], 2089 __( 'The language pack is missing either the <code>.po</code> or <code>.mo</code> files.' ) ); 2107 /* translators: 1: .po 2: .mo */ 2108 sprintf( __( 'The language pack is missing either the %1$s or %2$s files.' ), 2109 '<code>.po</code>', 2110 '<code>.mo</code>' 2111 ) 2112 ); 2113 } 2090 2114 2091 2115 return $source;
Note: See TracChangeset
for help on using the changeset viewer.