I was try many answred question here...
Like remove space before <?php
and after ?>
not working at all Iam still stucked..
My code below..
add_action( 'admin_notices', 'fii' );
function fii(){
// parent plugin
if ( ! is_plugin_active( 'xxx/aaa.php' ) and current_user_can( 'activate_plugins' ) ) {
echo '<div class="notice notice-warning"><p>You need install xxxx plugin</p></div>';
}
}
register_activation_hook( __FILE__, 'fii' );
The problem is when active my plugin, wordpress give me error info like this..
"The plugin generated 281 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin."
But when i close my echo inside fii function, its fine"
add_action( 'admin_notices', 'fii' );
function fii(){
// parent plugin
if ( ! is_plugin_active( 'xxx/aaa.php' ) and current_user_can( 'activate_plugins' ) ) {
//echo '<div class="notice notice-warning"><p>You need install xxxx plugin</p></div>';
}
}
register_activation_hook( __FILE__, 'fii');
WHat wrong with my echo ??