Skip to content

Commit

Permalink
Merge branch 'release/2.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ClassyBot committed Jun 20, 2024
2 parents 032699c + f1789da commit 1069dab
Show file tree
Hide file tree
Showing 16 changed files with 300 additions and 137 deletions.
25 changes: 18 additions & 7 deletions wp-admin/includes/class-wp-plugin-install-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ private function order_callback( $plugin_a, $plugin_b ) {
}

public function display_rows() {
$updates_from_api = get_site_transient( 'update_core' );
$cp_needs_update = isset( $updates_from_api->updates ) && is_array( $updates_from_api->updates ) && ! empty( $updates_from_api->updates );

$plugins_allowedtags = array(
'a' => array(
'href' => array(),
Expand Down Expand Up @@ -651,12 +654,20 @@ public function display_rows() {
if ( ! $compatible_php && ! $compatible_wp ) {
_e( 'This plugin does not work with your versions of ClassicPress and PHP.' );
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
if ( $cp_needs_update ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
} else {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
}
wp_update_php_annotation( '</p><p><em>', '</em>' );
} elseif ( current_user_can( 'update_core' ) ) {
printf(
Expand All @@ -674,7 +685,7 @@ public function display_rows() {
}
} elseif ( ! $compatible_wp ) {
_e( 'This plugin does not work with your version of ClassicPress.' );
if ( current_user_can( 'update_core' ) ) {
if ( current_user_can( 'update_core' ) && $cp_needs_update ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update ClassicPress</a>.' ),
Expand Down
26 changes: 19 additions & 7 deletions wp-admin/includes/class-wp-plugins-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,10 @@ public function display_rows() {
* @param array $item
*/
public function single_row( $item ) {

$updates_from_api = get_site_transient( 'update_core' );
$cp_needs_update = isset( $updates_from_api->updates ) && is_array( $updates_from_api->updates ) && ! empty( $updates_from_api->updates );

global $status, $page, $s, $totals;
static $plugin_id_attrs = array();

Expand Down Expand Up @@ -1272,12 +1276,20 @@ public function single_row( $item ) {
if ( ! $compatible_php && ! $compatible_wp ) {
_e( 'This plugin does not work with your versions of ClassicPress and PHP.' );
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
if ( $cp_needs_update ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
} else {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
}
wp_update_php_annotation( '</p><p><em>', '</em>' );
} elseif ( current_user_can( 'update_core' ) ) {
printf(
Expand All @@ -1295,7 +1307,7 @@ public function single_row( $item ) {
}
} elseif ( ! $compatible_wp ) {
_e( 'This plugin does not work with your version of ClassicPress.' );
if ( current_user_can( 'update_core' ) ) {
if ( current_user_can( 'update_core' ) && $cp_needs_update ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update ClassicPress</a>.' ),
Expand Down
51 changes: 35 additions & 16 deletions wp-admin/includes/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,9 @@ function wp_prepare_themes_for_js( $themes = null ) {
* @since 4.2.0
*/
function customize_themes_print_templates() {
$updates_from_api = get_site_transient( 'update_core' );
$cp_needs_update = isset( $updates_from_api->updates ) && is_array( $updates_from_api->updates ) && ! empty( $updates_from_api->updates );

?>
<script type="text/html" id="tmpl-customize-themes-details-view">
<div class="theme-backdrop"></div>
Expand Down Expand Up @@ -864,14 +867,22 @@ function customize_themes_print_templates() {
'{{{ data.name }}}'
);
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
if ( $cp_needs_update ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
} else {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
}
wp_update_php_annotation( '</p><p><em>', '</em>' );
} elseif ( current_user_can( 'update_core' ) ) {
} elseif ( current_user_can( 'update_core' ) && $cp_needs_update ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update ClassicPress</a>.' ),
Expand All @@ -893,7 +904,7 @@ function customize_themes_print_templates() {
__( 'There is a new version of %s available, but it does not work with your version of ClassicPress.' ),
'{{{ data.name }}}'
);
if ( current_user_can( 'update_core' ) ) {
if ( current_user_can( 'update_core' ) && $cp_needs_update ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update ClassicPress</a>.' ),
Expand Down Expand Up @@ -941,14 +952,22 @@ function customize_themes_print_templates() {
<?php
_e( 'This theme does not work with your versions of ClassicPress and PHP.' );
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
if ( $cp_needs_update ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
} else {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
}
wp_update_php_annotation( '</p><p><em>', '</em>' );
} elseif ( current_user_can( 'update_core' ) ) {
} elseif ( current_user_can( 'update_core' ) && $cp_needs_update ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update ClassicPress</a>.' ),
Expand All @@ -966,7 +985,7 @@ function customize_themes_print_templates() {
<# } else if ( ! data.compatibleWP ) { #>
<?php
_e( 'This theme does not work with your version of ClassicPress.' );
if ( current_user_can( 'update_core' ) ) {
if ( current_user_can( 'update_core' ) && $cp_needs_update ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update ClassicPress</a>.' ),
Expand Down
14 changes: 13 additions & 1 deletion wp-admin/includes/update-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@
// Added in 5.2.3 or older, not included in ClassicPress
'wp-includes/sodium_compat',

// Removed in ClassiPress 2.1.0
'wp-includes/js/swfupload',
'wp-includes/js/swfobject.js',
'wp-includes/js/mediaelement/mediaelement-migrate.js',
'wp-includes/js/mediaelement/mediaelement-migrate.min.js',
'wp-includes/js/mediaelement/mejs-controls.png',
'wp-admin/js/tags-suggest.js',
'wp-admin/js/tags-suggest.min.js',
'wp-admin/js/user-suggest.js',
'wp-admin/js/user-suggest.min.js',

// Directories.
'wp-includes/css/dist',
'wp-includes/block-patterns',
Expand Down Expand Up @@ -197,7 +208,8 @@
global $_new_bundled_files;

$_new_bundled_files = array(
'themes/twentyseventeen/' => '4.7',
'themes/twentyseventeen/' => '4.7',
'themes/the-classicpress-theme/' => '6.2.6',
);

/**
Expand Down
28 changes: 19 additions & 9 deletions wp-admin/includes/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,10 @@ function wp_theme_update_rows() {
* @return void|false
*/
function wp_theme_update_row( $theme_key, $theme ) {
$current = get_site_transient( 'update_themes' );

$updates_from_api = get_site_transient( 'update_core' );
$cp_needs_update = isset( $updates_from_api->updates ) && is_array( $updates_from_api->updates ) && ! empty( $updates_from_api->updates );
$current = get_site_transient( 'update_themes' );

if ( ! isset( $current->response[ $theme_key ] ) ) {
return false;
Expand Down Expand Up @@ -727,14 +730,21 @@ function wp_theme_update_row( $theme_key, $theme ) {
$theme['Name']
);
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
if ( $cp_needs_update ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
} else {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
); }
wp_update_php_annotation( '</p><p><em>', '</em>' );
} elseif ( current_user_can( 'update_core' ) ) {
} elseif ( current_user_can( 'update_core' ) && $cp_needs_update ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update ClassicPress</a>.' ),
Expand All @@ -754,7 +764,7 @@ function wp_theme_update_row( $theme_key, $theme ) {
__( 'There is a new version of %s available, but it does not work with your version of ClassicPress.' ),
$theme['Name']
);
if ( current_user_can( 'update_core' ) ) {
if ( current_user_can( 'update_core' ) && $cp_needs_update ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update ClassicPress</a>.' ),
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/customize-controls.min.js

Large diffs are not rendered by default.

51 changes: 35 additions & 16 deletions wp-admin/theme-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/includes/theme-install.php';

$updates_from_api = get_site_transient( 'update_core' );
$cp_needs_update = isset( $updates_from_api->updates ) && is_array( $updates_from_api->updates ) && ! empty( $updates_from_api->updates );

wp_reset_vars( array( 'tab' ) );

if ( ! current_user_can( 'install_themes' ) ) {
Expand Down Expand Up @@ -292,14 +295,22 @@
<?php
_e( 'This theme does not work with your versions of ClassicPress and PHP.' );
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
if ( $cp_needs_update ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
} else {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
}
wp_update_php_annotation( '</p><p><em>', '</em>' );
} elseif ( current_user_can( 'update_core' ) ) {
} elseif ( current_user_can( 'update_core' ) && $cp_needs_update ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update ClassicPress</a>.' ),
Expand All @@ -321,7 +332,7 @@
<# } else if ( ! data.compatible_wp ) { #>
<?php
_e( 'This theme does not work with your version of ClassicPress.' );
if ( current_user_can( 'update_core' ) ) {
if ( current_user_can( 'update_core' ) && $cp_needs_update ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update ClassicPress</a>.' ),
Expand Down Expand Up @@ -497,14 +508,22 @@
<?php
_e( 'This theme does not work with your versions of ClassicPress and PHP.' );
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
if ( $cp_needs_update ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update ClassicPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
} else {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
}
wp_update_php_annotation( '</p><p><em>', '</em>' );
} elseif ( current_user_can( 'update_core' ) ) {
} elseif ( current_user_can( 'update_core' ) && $cp_needs_update ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update ClassicPress</a>.' ),
Expand All @@ -526,7 +545,7 @@
<# } else if ( ! data.compatible_wp ) { #>
<?php
_e( 'This theme does not work with your version of ClassicPress.' );
if ( current_user_can( 'update_core' ) ) {
if ( current_user_can( 'update_core' ) && $cp_needs_update ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update ClassicPress</a>.' ),
Expand Down
Loading

0 comments on commit 1069dab

Please sign in to comment.