WordPress.org

Making WordPress.org

Changeset 7321


Ignore:
Timestamp:
06/19/2018 10:45:07 PM (14 months ago)
Author:
coreymckrill
Message:

WordCamp: Fail the Gutenberg tweaks gracefully if the plugin isn't activated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/gutenberg-tweaks.php

    r6376 r7321  
    2121 *        for organizers.
    2222 */
     23function load() {
     24    if ( is_plugin_active( 'gutenberg/gutenberg.php' ) ) {
     25        add_filter( 'gutenberg_can_edit_post_type', __NAMESPACE__ . '\disable_gutenberg_on_cpts',           10, 2 );
     26        add_filter( 'get_edit_post_link',           __NAMESPACE__ . '\add_classic_param_to_edit_links'            );
     27        add_filter( 'page_row_actions',             __NAMESPACE__ . '\add_gutenberg_edit_link',             10, 2 );
     28        add_filter( 'post_row_actions',             __NAMESPACE__ . '\add_gutenberg_edit_link',             10, 2 );
     29        add_action( 'admin_print_scripts-edit.php', __NAMESPACE__ . '\add_classic_param_to_add_new_button', 11    );
     30        add_action( 'admin_print_scripts',          __NAMESPACE__ . '\add_classic_param_to_admin_menus',     1    );
     31    }
     32}
    2333
    24 add_filter( 'gutenberg_can_edit_post_type', __NAMESPACE__ . '\disable_gutenberg_on_cpts',           10, 2 );
    25 add_filter( 'get_edit_post_link',           __NAMESPACE__ . '\add_classic_param_to_edit_links'            );
    26 add_filter( 'page_row_actions',             __NAMESPACE__ . '\add_gutenberg_edit_link',             10, 2 );
    27 add_filter( 'post_row_actions',             __NAMESPACE__ . '\add_gutenberg_edit_link',             10, 2 );
    28 add_action( 'admin_print_scripts-edit.php', __NAMESPACE__ . '\add_classic_param_to_add_new_button', 11    );
    29 add_action( 'admin_print_scripts',          __NAMESPACE__ . '\add_classic_param_to_admin_menus',     1    );
    30 
     34add_action( 'plugins_loaded', __NAMESPACE__ . '\load' );
    3135
    3236/**
Note: See TracChangeset for help on using the changeset viewer.