I have developed a custom plugin in wordpress it was working fine but suddenly I got an unusual error stated as follows
Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in /public_html/demo2/wp-content/plugins/my-plugin-custom/inc/admin/Settings.php on line 7
Here is what goes goes under line 7
<?php
/**
* @package My Custom Plugin
*/
namespace Inc\admin;
class Settings {
public function register() {
add_action( 'admin_menu', array( $this, 'add_admin_menu' ) );
}
}
Can anyone could help me out with this issue what exactly is going on I am really much confused