Answer the question
In order to leave comments, you need to log in
How to check before plugin activation?
I am writing a small plugin that will be an addition to a third-party plugin.
I can’t find anywhere how to perform such a check before activating the plugin:
if( is_plugin_active( 'сторонний плагин' ) ) {
активируем плагин;
} else {
add_action( 'admin_notices', 'my_plugin_error_notice' );
function my_plugin_error_notice( ) {
$message = 'Плагин такой-то должен быть установлен и активен';
echo '<div class="notice notice-error is-dismissible"><p>' . $message . '</p></div>';
}
}
Answer the question
In order to leave comments, you need to log in
So, what exactly is the question? You wrote the check correctly, documentation
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question