From f7235c684587eb749a2313e5f7a1ad9ef6297221 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Mon, 28 Jan 2019 11:42:28 -0500 Subject: [PATCH] Plugin: Remove lingering references to integrated Classic Editor --- .../backward-compatibility/deprecations.md | 3 ++ gutenberg.php | 24 +++--------- lib/client-assets.php | 2 +- lib/register.php | 32 +++++----------- phpunit/class-admin-test.php | 37 ------------------- 5 files changed, 19 insertions(+), 79 deletions(-) diff --git a/docs/designers-developers/developers/backward-compatibility/deprecations.md b/docs/designers-developers/developers/backward-compatibility/deprecations.md index 6ff124b27a34f..3f8abd10d8642 100644 --- a/docs/designers-developers/developers/backward-compatibility/deprecations.md +++ b/docs/designers-developers/developers/backward-compatibility/deprecations.md @@ -58,6 +58,9 @@ The Gutenberg project's deprecation policy is intended to support backward compa - The PHP function `gutenberg_collect_meta_box_data` has been removed. Use [`register_and_do_post_meta_boxes`](https://developer.wordpress.org/reference/functions/register_and_do_post_meta_boxes/) instead. - `window._wpLoadGutenbergEditor` has been removed. Use `window._wpLoadBlockEditor` instead. Note: This is a private API, not intended for public use. It may be removed in the future. - The PHP function `gutenberg_get_script_polyfill` has been removed. Use [`wp_get_script_polyfill`](https://developer.wordpress.org/reference/functions/wp_get_script_polyfill/) instead. +- The PHP function `gutenberg_redirect_to_classic_editor_when_saving_posts` has been removed. +- The PHP function `gutenberg_revisions_link_to_editor` has been removed. +- The PHP function `gutenberg_remember_classic_editor_when_saving_posts` has been removed. ## 4.5.0 - `Dropdown.refresh()` has been deprecated as the contained `Popover` is now automatically refreshed. diff --git a/gutenberg.php b/gutenberg.php index 13f0e148b57de..4daf0504bdac9 100644 --- a/gutenberg.php +++ b/gutenberg.php @@ -31,21 +31,11 @@ function the_gutenberg_project() { @@ -128,10 +118,6 @@ function is_gutenberg_page() { return false; } - if ( isset( $_GET['classic-editor'] ) ) { - return false; - } - if ( ! gutenberg_can_edit_post( $post ) ) { return false; } diff --git a/lib/client-assets.php b/lib/client-assets.php index 469310edbe118..1ec7752a8c072 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -1152,7 +1152,7 @@ function gutenberg_editor_scripts_and_styles( $hook ) { $post_autosave = gutenberg_get_autosave_newer_than_post_save( $post ); if ( $post_autosave ) { $editor_settings['autosave'] = array( - 'editLink' => add_query_arg( 'gutenberg', true, get_edit_post_link( $post_autosave->ID ) ), + 'editLink' => get_edit_post_link( $post_autosave->ID ), ); } diff --git a/lib/register.php b/lib/register.php index ebdc43c7f2e5c..f8f7410d31253 100644 --- a/lib/register.php +++ b/lib/register.php @@ -203,67 +203,55 @@ function gutenberg_bulk_post_updated_messages( $messages ) { * Injects a hidden input in the edit form to propagate the information that classic editor is selected. * * @since 1.5.2 + * @deprecated 5.0.0 */ function gutenberg_remember_classic_editor_when_saving_posts() { - ?> - - assertTrue( gutenberg_content_has_blocks( $content_with_blocks ) ); $this->assertFalse( gutenberg_content_has_blocks( $content_without_blocks ) ); } - - /** - * Test that the revisions 'return to editor' links are set correctly for Classic & Gutenberg editors. - * - * @covers ::gutenberg_revisions_link_to_editor - */ - function test_gutenberg_revisions_link_to_editor() { - global $pagenow; - - // Set up $pagenow so the filter will work. - $pagenow = 'revision.php'; - - // Test the filter when Gutenberg is the active editor. - $_REQUEST['gutenberg'] = '1'; - $link = apply_filters( 'get_edit_post_link', 'http://test.com' ); - $this->assertEquals( 'http://test.com', $link ); - - // Test the filter when Gutenberg is not the active editor. - unset( $_REQUEST['gutenberg'] ); - $link = apply_filters( 'get_edit_post_link', 'http://test.com' ); - $this->assertEquals( 'http://test.com?classic-editor', $link ); - } - - /** - * Test that the revisions 'restore this revision' button links correctly for Classic & Gutenberg editors. - */ - function test_gutenberg_revisions_restore() { - // Test the filter when Gutenberg is the active editor. - $_REQUEST['gutenberg'] = '1'; - $link = apply_filters( 'wp_prepare_revision_for_js', array( 'restoreUrl' => 'http://test.com' ) ); - $this->assertEquals( array( 'restoreUrl' => 'http://test.com?gutenberg=1' ), $link ); - - // Test the filter when Gutenberg is not the active editor. - unset( $_REQUEST['gutenberg'] ); - $link = apply_filters( 'wp_prepare_revision_for_js', array( 'restoreUrl' => 'http://test.com' ) ); - $this->assertEquals( array( 'restoreUrl' => 'http://test.com' ), $link ); - } }