Changeset 1910026 for classic-editor
- Timestamp:
- 07/16/2018 07:27:40 PM (7 years ago)
- Location:
- classic-editor/trunk
- Files:
-
- 5 edited
-
classic-editor.php (modified) (9 diffs)
-
readme.txt (modified) (1 diff)
-
screenshot-1.png (modified) (previous)
-
screenshot-2.png (modified) (previous)
-
screenshot-3.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
classic-editor/trunk/classic-editor.php
r1786604 r1910026 6 6 * Plugin URI: https://wordpress.org 7 7 * Description: Enables the WordPress classic editor and the old-style Edit Post screen layout (TinyMCE, meta boxes, etc.). Supports the older plugins that extend this screen. 8 * Version: 0. 28 * Version: 0.3 9 9 * Author: WordPress Contributors 10 10 * License: GPL-2.0+ … … 35 35 */ 36 36 function classic_editor_is_gutenberg_active() { 37 if ( in_array( 'gutenberg/gutenberg.php', (array) get_option( 'active_plugins' , array()) ) ||37 if ( in_array( 'gutenberg/gutenberg.php', (array) get_option( 'active_plugins' ) ) || 38 38 ( is_multisite() && array_key_exists( 'gutenberg/gutenberg.php', (array) get_site_option( 'active_sitewide_plugins' ) ) ) ) { 39 39 … … 59 59 // gutenberg.php 60 60 remove_action( 'admin_menu', 'gutenberg_menu' ); 61 remove_action( 'load-post.php', 'gutenberg_intercept_edit_post' );62 remove_action( 'load-post-new.php', 'gutenberg_intercept_post_new' );63 61 remove_action( 'admin_notices', 'gutenberg_wordpress_version_notice' ); 64 62 remove_action( 'admin_init', 'gutenberg_redirect_demo' ); 65 63 66 64 remove_filter( 'replace_editor', 'gutenberg_init' ); 67 68 // lib/blocks.php69 remove_filter( 'wp_insert_post_data', 'gutenberg_wpautop_insert_post_data' );70 65 71 66 // lib/client-assets.php … … 76 71 77 72 // lib/compat.php 78 remove_action( 'wp_enqueue_scripts', 'gutenberg_ensure_wp_api_request', 20 );79 remove_action( 'admin_enqueue_scripts', 'gutenberg_ensure_wp_api_request', 20 );80 81 remove_filter( 'wp_editor_settings', 'gutenberg_disable_editor_settings_wpautop' );82 73 remove_filter( 'wp_refresh_nonces', 'gutenberg_add_rest_nonce_to_heartbeat_response_headers' ); 83 74 84 75 // lib/register.php 85 76 remove_action( 'plugins_loaded', 'gutenberg_trick_plugins_into_registering_meta_boxes' ); 86 remove_action( 'rest_api_init', 'gutenberg_register_rest_routes' );87 remove_action( 'rest_api_init', 'gutenberg_register_rest_api_post_revisions' );88 77 remove_action( 'edit_form_top', 'gutenberg_remember_classic_editor_when_saving_posts' ); 89 78 … … 91 80 remove_filter( 'get_edit_post_link', 'gutenberg_revisions_link_to_editor' ); 92 81 remove_filter( 'wp_prepare_revision_for_js', 'gutenberg_revisions_restore' ); 82 83 // lib/rest-api.php 84 remove_action( 'rest_api_init', 'gutenberg_register_rest_routes' ); 85 remove_action( 'rest_api_init', 'gutenberg_add_taxonomy_visibility_field' ); 86 87 remove_filter( 'rest_request_after_callbacks', 'gutenberg_filter_oembed_result' ); 88 remove_filter( 'registered_post_type', 'gutenberg_register_post_prepare_functions' ); 89 remove_filter( 'registered_taxonomy', 'gutenberg_register_taxonomy_prepare_functions' ); 90 remove_filter( 'rest_index', 'gutenberg_ensure_wp_json_has_theme_supports' ); 91 remove_filter( 'rest_request_before_callbacks', 'gutenberg_handle_early_callback_checks' ); 92 remove_filter( 'rest_user_collection_params', 'gutenberg_filter_user_collection_parameters' ); 93 remove_filter( 'rest_request_after_callbacks', 'gutenberg_filter_request_after_callbacks' ); 93 94 94 95 // lib/meta-box-partial-page.php … … 108 109 // gutenberg.php 109 110 remove_filter( 'admin_url', 'gutenberg_modify_add_new_button_url' ); 111 remove_action( 'admin_print_scripts-edit.php', 'gutenberg_replace_default_add_new_button' ); 112 113 // lib/register.php 114 remove_filter( 'display_post_states', 'gutenberg_add_gutenberg_post_state' ); 115 116 // lib/plugin-compat.php 117 remove_filter( 'rest_pre_insert_post', 'gutenberg_remove_wpcom_markdown_support' ); 118 119 // Keep 110 120 111 121 // lib/blocks.php 112 122 // remove_filter( 'the_content', 'do_blocks', 9 ); 113 123 114 // lib/register.php 115 remove_filter( 'display_post_states', 'gutenberg_add_gutenberg_post_state', 10 ); 116 117 // lib/plugin-compat.php 118 remove_filter( 'rest_pre_insert_post', 'gutenberg_remove_wpcom_markdown_support' ); 119 120 // Keep 121 // remove_filter( 'rest_index', 'gutenberg_ensure_wp_json_has_permalink_structure' ); 124 // Continue to disable wpautop inside TinyMCE for posts that were started in Gutenberg. 125 // remove_filter( 'wp_editor_settings', 'gutenberg_disable_editor_settings_wpautop' ); 126 127 // Keep the tweaks to the PHP wpautop. 122 128 // add_filter( 'the_content', 'wpautop' ); 123 129 // remove_filter( 'the_content', 'gutenberg_wpautop', 8 ); 130 124 131 // remove_action( 'init', 'gutenberg_register_post_types' ); 125 132 } else { … … 140 147 // Gutenberg plugin: remove the "Classic editor" row actions. 141 148 remove_action( 'admin_init', 'gutenberg_add_edit_link_filters' ); 149 150 // Remove the "Try Gutenberg" dashboard widget. 151 remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' ); 142 152 } 143 153 … … 159 169 */ 160 170 function classic_editor_settings() { 161 $ no_replace = get_option( 'classic-editor-replace' ) === 'no-replace';171 $replace = get_option( 'classic-editor-replace' ) !== 'no-replace'; 162 172 163 173 ?> 164 <p id="classic-editor-options" style="margin: 0;"><label> 165 <input type="checkbox" name="classic-editor-replace" value="no-replace"<?php if ( $no_replace ) echo ' checked'; ?> /> 166 <?php _e( 'Do not replace the editor. Add alternate links to the Posts and Pages screens for editing with the Classic editor.', 'classic-editor' ); ?> 167 </label></p> 174 <p id="classic-editor-options" style="margin: 0;"> 175 <input type="radio" name="classic-editor-replace" id="classic-editor-replace" value="replace"<?php if ( $replace ) echo ' checked'; ?> /> 176 <label for="classic-editor-replace"> 177 <?php _e( 'Replace the Gutenberg editor with the Classic editor.', 'classic-editor' ); ?> 178 </label> 179 <br> 180 181 <input type="radio" name="classic-editor-replace" id="classic-editor-no-replace" value="no-replace"<?php if ( ! $replace ) echo ' checked'; ?> /> 182 <label for="classic-editor-no-replace"> 183 <?php _e( 'Use the Gutenberg editor by default and include optional links back to the Classic editor.', 'classic-editor' ); ?> 184 </label> 185 </p> 168 186 <script> 169 187 jQuery( 'document' ).ready( function( $ ) { 170 188 if ( window.location.hash === '#classic-editor-options' ) { 171 $( '#classic-editor-options' ).closest( 'td' ). css( 'border', '1px solid #aaa' );189 $( '#classic-editor-options' ).closest( 'td' ).addClass( 'highlight' ); 172 190 } 173 191 } ); … … 334 352 function classic_editor_activate() { 335 353 if ( ! get_option( 'classic-editor-replace' ) ) { 336 update_option( 'classic-editor-replace', ' no-replace' );354 update_option( 'classic-editor-replace', 'replace' ); 337 355 } 338 356 } -
classic-editor/trunk/readme.txt
r1786604 r1910026 27 27 28 28 == Changelog == 29 = 0.3 = 30 Updated the option from a checkbox to couple of radio buttons, seems clearer. Thanks to @designsimply for the label text suggestions. 31 Some general updates and cleanup. 32 29 33 = 0.2 = 30 34 Update for Gutenberg 1.9.
Note: See TracChangeset
for help on using the changeset viewer.