• Resolved Pavel Mares

    (@pavelmares)


    If I have Classic Editor in MU Plugins or inside my custom plugin, I can’t activate it.

    But for me it is not a problem, I just load your plugin inside my initialisation. But for others that may be a problem.

    • This topic was modified 3 years, 1 month ago by Pavel Mares.
    • This topic was modified 3 years, 1 month ago by Pavel Mares.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Pieter Bos

    (@senlin)

    Hi Pavel,

    When you use your plugin(s) in an irregular setup, then I can imagine that some things don’t work.

    My plugin uses the is_plugin_active() directive, which is fairly standard practice I think?

    Thread Starter Pavel Mares

    (@pavelmares)

    I ain’t saying it isn’t would be nice to add “filter” for disabling this feature. Which is 1 line of code to prevent this issue.

    And loading plugins inside plugins is not exactly “irregular” setup. I fixed it via this code, so it’s fine for now.

    add_filter( 'option_active_plugins', function( $plugins ){
        foreach( (array) debug_backtrace() as $item ) {
            if( array_key_exists( 'function', $item ) && $item['function'] == 'cea_depends_on_ce' ) {
                $plugins[] = 'classic-editor/classic-editor.php';
                break;
            }
        }
    
        return $plugins;
    });
    • This reply was modified 3 years, 1 month ago by Pavel Mares.
    Plugin Author Pieter Bos

    (@senlin)

    Hi Pavel,

    Glad you managed to solve this specific issue by adding a filter and thanks for sharing it so it might help others too.

    I will add it to the repo at Github, so it can still be found in the future too.

    Plugin Author Pieter Bos

    (@senlin)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Classic editor as MU Plugin’ is closed to new replies.