From 29380e479bd725f32d3f6a7f4eeced8f8495e0a1 Mon Sep 17 00:00:00 2001 From: Bitpoke Bot Date: Wed, 4 Dec 2024 08:46:13 +0000 Subject: [PATCH] Update `Classic Editor` plugin from 1.6.6 to 1.6.7 --- .../plugins/classic-editor/classic-editor.php | 44 ++++++++----------- wp-content/plugins/classic-editor/readme.txt | 7 ++- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/wp-content/plugins/classic-editor/classic-editor.php b/wp-content/plugins/classic-editor/classic-editor.php index 563437c10..b0c1af482 100644 --- a/wp-content/plugins/classic-editor/classic-editor.php +++ b/wp-content/plugins/classic-editor/classic-editor.php @@ -5,7 +5,7 @@ * Plugin Name: Classic Editor * Plugin URI: https://wordpress.org/plugins/classic-editor/ * Description: Enables the WordPress classic editor and the old-style Edit Post screen with TinyMCE, Meta Boxes, etc. Supports the older plugins that extend this screen. - * Version: 1.6.6 + * Version: 1.6.7 * Author: WordPress Contributors * Author URI: https://github.com/WordPress/classic-editor/ * License: GPLv2 or later @@ -69,11 +69,11 @@ public static function init_actions() { // Fix for Safari 18 negative horizontal margin on floats. add_action( 'admin_print_styles', array( __CLASS__, 'safari_18_temp_fix' ) ); - // Fix for the Categories postbox for WP 6.7.1. + // Fix for the Categories postbox on the classic Edit Post screen for WP 6.7.1. global $wp_version; if ( '6.7.1' === $wp_version && is_admin() ) { - add_action( 'wp_default_scripts', array( __CLASS__, 'replace_post_js' ), 11 ); + add_filter( 'script_loader_src', array( __CLASS__, 'replace_post_js_2' ), 11, 2 ); } if ( ! $block_editor && ! $gutenberg ) { @@ -1007,32 +1007,24 @@ public static function safari_18_temp_fix() { } } - /** - * Temporary fix for the Categories postbox on the classic Edit Post screen. - * See: https://core.trac.wordpress.org/ticket/62504. - */ + // Back-compat with 1.6.6. public static function replace_post_js( $scripts ) { - $script = $scripts->query( 'post', 'registered' ); - $suffix = wp_scripts_get_suffix(); - - if ( $script ) { - if ( '62504-20241121' === $script->ver ) { - // The script src was replaced from another plugin. - return; - } + _deprecated_function( __METHOD__, '1.6.7' ); + } - $script->src = plugins_url( 'scripts/', __FILE__ ) . "post{$suffix}.js"; - $script->ver = '62504-20241121'; - } else { - $scripts->add( - 'post', - plugins_url( 'scripts/', __FILE__ ) . "post{$suffix}.js", - array( 'suggest', 'wp-lists', 'postbox', 'tags-box', 'underscore', 'word-count', 'wp-a11y', 'wp-sanitize', 'clipboard' ), - '62504-20241121', - 1 - ); - $scripts->set_translations( 'post' ); + /** + * Fix for the Categories postbox on the classic Edit Post screen for WP 6.7.1. + * See: https://core.trac.wordpress.org/ticket/62504 and + * https://github.com/WordPress/classic-editor/issues/222. + */ + public static function replace_post_js_2( $src, $handle ) { + if ( 'post' === $handle && is_string( $src ) && false === strpos( $src, 'ver=62504-20241121' ) ) { + $suffix = wp_scripts_get_suffix(); + $src = plugins_url( 'scripts/', __FILE__ ) . "post{$suffix}.js"; + $src = add_query_arg( 'ver', '62504-20241121', $src ); } + + return $src; } } diff --git a/wp-content/plugins/classic-editor/readme.txt b/wp-content/plugins/classic-editor/readme.txt index 9866fd54a..d7a446ddc 100644 --- a/wp-content/plugins/classic-editor/readme.txt +++ b/wp-content/plugins/classic-editor/readme.txt @@ -1,9 +1,9 @@ === Classic Editor === Contributors: wordpressdotorg, azaozz, melchoyce, chanthaboune, alexislloyd, pento, youknowriad, desrosj, luciano-croce, ironprogrammer -Tags: gutenberg, disable, disable gutenberg, editor, classic editor, block editor +Tags: classic editor, block editor, editor, gutenberg Requires at least: 4.9 Tested up to: 6.7 -Stable tag: 1.6.6 +Stable tag: 1.6.7 Requires PHP: 5.2.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -29,6 +29,9 @@ By default, this plugin hides all functionality available in the new block edito == Changelog == += 1.6.7 = +* Fixed loading of script translations when post.js is replaced in WordPress 6.7.1. + = 1.6.6 = * Added fix for selecting/deselecting multiple unwanted categories in WordPress 6.7.1 when clicking on a category checkbox on the old Edit Post screen.