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?
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 4 years, 3 months ago by
Pavel Mares.
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.