Skip to content

Commit

Permalink
Update Classic Editor plugin from 1.6.6 to 1.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpoke-bot committed Dec 4, 2024
1 parent 8f69514 commit 29380e4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
44 changes: 18 additions & 26 deletions wp-content/plugins/classic-editor/classic-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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;
}
}

Expand Down
7 changes: 5 additions & 2 deletions wp-content/plugins/classic-editor/readme.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.

Expand Down

0 comments on commit 29380e4

Please sign in to comment.