Is there a community equal to ‘admin_init’, or what do I’ve to do so as to add an motion to community admin screens? I take advantage of ‘admin_init’ for an motion on admin community screens, however the respective perform isn’t executed. Thanks!
Edit: This is what I need to do. The respective plugin writes customized database tables and will due to this fact solely by activated on a per-site foundation in a community.
perform no_network_activation() {
if ( is_network_admin() && isset($_GET['no-network-activation']) ) {
add_action( 'network_admin_notices', 'no_network_activation_notice' );
deactivate_plugins( plugin_basename( __FILE__ ) );
if ( isset( $_GET['activate'] ) ) {
unset( $_GET['activate'] );
}
}
}
add_action( 'admin_init', 'no_network_activation' );
perform no_network_activation_notice(){
// Echo an admin discover: no community activation potential
}
perform myplugin_database_adder($networkwide) {
// Redirect to community plugin url and add param to point out the try of network-wide plugin activation
if (is_multisite() && $networkwide) {
header( 'Location: ' . network_admin_url( 'plugins.php?no-network-activation=true' ) );
exit;
}
else {
// Add the plugin database tables
// [...]
}
}
register_activation_hook( __FILE__, 'myplugin_database_adder' );