• when you put this + this plug-in, gutenberk is atomized. i can trust in the future of wordpress (thanks for the hooks). it was a pity to install gutenberk, but a pleasure to destroy it

    ??

    function kill_gutenberg_post_type( $is_enabled, $post_type ) {

    if ( ‘post’ === $post_type || ‘page’ === $post_type ) {
    return false; //==> add_action( ‘admin_print_scripts-edit.php’,…) ==> gutenberg_replace_default_add_new_button is disabled
    }
    return $is_enabled;
    }
    add_filter( ‘gutenberg_can_edit_post_type’, ‘kill_gutenberg_post_type’, 10, 2 ); //gutenberg_add_edit_link_for_post_type

    function kill_gutenberg_modify_add_new_button_url( $url, $path ) {
    return str_replace(‘&classic-editor’,”,$url);
    }
    add_filter( ‘admin_url’, ‘kill_gutenberg_modify_add_new_button_url’, 10, 2 );

    function kill_gutenberg_add_gutenberg_post_state( $post_states, $post ) {
    return [];
    }
    add_filter( ‘display_post_states’, ‘kill_gutenberg_add_gutenberg_post_state’, 10, 2 );

    // gutenberg.php
    remove_filter( ‘replace_editor’, ‘gutenberg_init’ );
    remove_action( ‘load-post.php’, ‘gutenberg_intercept_edit_post’ );
    remove_action( ‘load-post-new.php’, ‘gutenberg_intercept_post_new’ );
    remove_action( ‘admin_notices’, ‘gutenberg_wordpress_version_notice’ );
    remove_action( ‘admin_init’, ‘gutenberg_redirect_demo’ );
    remove_action( ‘admin_menu’, ‘gutenberg_menu’ );
    // lib/client-assets.php
    remove_action( ‘wp_enqueue_scripts’, ‘gutenberg_register_scripts_and_styles’, 5 );
    remove_action( ‘admin_enqueue_scripts’, ‘gutenberg_register_scripts_and_styles’, 5 );
    remove_action( ‘wp_enqueue_scripts’, ‘gutenberg_common_scripts_and_styles’ );
    remove_action( ‘admin_enqueue_scripts’, ‘gutenberg_common_scripts_and_styles’ );
    // lib/compat.php
    remove_action( ‘wp_enqueue_scripts’, ‘gutenberg_ensure_wp_api_request’, 20 );
    remove_action( ‘admin_enqueue_scripts’, ‘gutenberg_ensure_wp_api_request’, 20 );
    remove_filter( ‘wp_editor_settings’, ‘gutenberg_disable_editor_settings_wpautop’ );
    remove_filter( ‘wp_refresh_nonces’, ‘gutenberg_add_rest_nonce_to_heartbeat_response_headers’ );
    // lib/register.php
    remove_action( ‘rest_api_init’, ‘gutenberg_register_rest_routes’ );
    // Metaboxes hacks
    remove_action( ‘do_meta_boxes’, ‘gutenberg_meta_box_partial_page’, 1000 );
    remove_action( ‘plugins_loaded’, ‘gutenberg_trick_plugins_into_registering_meta_boxes’ );

    yesss :|)

    • This topic was modified 7 years, 3 months ago by lcazprof.
    • This topic was modified 7 years, 3 months ago by lcazprof.
    • This topic was modified 7 years, 3 months ago by lcazprof.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘good idea but dont work ? maybe an error for me’ is closed to new replies.