Support » Plugin: Admin Page Framework » Error in console

  • I have an issue in chrome console.

    https://imgur.com/a/BDkGUkl

    
    public function setUp() {
    	$this->setRootMenuPage('Settings');
    
    	$this->addSubMenuItem(
    		array(
    			'title'     => 'Theme Settings',
    			'page_slug' => 'theme_settings',
    		)
    	);
    
    	$this->addInPageTabs(
    		'theme_settings',
    		array(
    			'tab_slug' => 'home',
    			'title'    => 'Home',
    		),
    		array(
    			'tab_slug' => 'support',
    			'title'    => 'Sopport',
    		)
    	);
    }
    
    public function load() {
    	new Select2CustomFieldType( 'MyThemeAdmin' );
    }
    
    • This topic was modified 4 months, 2 weeks ago by  bilimokur.
    • This topic was modified 4 months, 2 weeks ago by  bilimokur.
Viewing 1 replies (of 1 total)
  • Plugin Author miunosoft

    (@miunosoft)

    Hi,

    I cannot reproduce the error.

    The console error indicates that necessary APF related JavaScript scripts are not loaded. I would try loading the class with the plugins_loaded action hook.

    
    add_action( 'plugins_loaded', 'loadAPFTestConsoleError' );
    function loadAPFTestConsoleError() {
        include( dirname( __FILE__ ) . '/classes/MyThemeAdmin.php' );  // set your path of the class
        new MyThemeAdmin;
    }
    

    Also please make sure that the MyThemeAdmin class extends the AdminPageFramework class like the below.

    
    class MyThemeAdmin extends AdminPageFramework {
    

    If these don’t help, please provide the steps to reproduce the error. Thank you.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.