The plugin generated 12 characters of unexpected output during activation. If you notice “headers already sent” messages,

Question

I create test plugin for learn purpose. i face this error on plugin activation.

error: The plugin generated 12 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.

 define('PLUGIN_PATH', plugin_dir_path(__FILE__));
include PLUGIN_PATH . 'inc/class-menu.php';

if(!class_exists('my_test')):
class my_test{
    public function __construct(){
      
    }
   
  
}

add_action('admin_menu', array($display_menu, 'reg_my_menu'));



new my_test;
endif;

included file code:

    class display_menu{
        
       
        public function reg_my_menu()
        {
           add_menu_page( 'Breaking API', 'Breaking API', 'manage_options', 'breaking-api', array($this, 'setting_page_html_cb'), '', 76 );
        }
        public function setting_page_html_cb()
        {
           ?> <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
           <?php
           $this->my_page();
          
        }
      public function my_page()
  {
    echo 'this is my html page';
  }

    }
    
    
    $display_menu=  new display_menu;
    endif;
0
, Talha 1 year 2020-07-15T05:11:14-05:00 0 Answers 54 views 0

Leave an answer

Browse
Browse