oFactory = $oFactory; $this->sClassName = $oFactory->oProp->sClassName; $this->sPageSlug = $sPageSlug; $this->sSectionID = $this->sTabSlug; $this->oFactory->addInPageTabs( $this->sPageSlug, array( 'tab_slug' => $this->sTabSlug, 'title' => 'Resources', 'style' => dirname( __FILE__ ) . '/asset/css/test-style.css', 'script' => dirname( __FILE__ ) . '/asset/js/test-js.js', ) ); // load + page slug + tab slug add_action( 'load_' . $this->sPageSlug . '_' . $this->sTabSlug, array( $this, 'replyToLoadTab' ) ); add_action( 'do_' . $this->sPageSlug . '_' . $this->sTabSlug, array( $this, 'replyToDoTab' ) ); $this->oFactory->enqueueScript( dirname( __FILE__ ) . '/asset/js/test-js2.js' ); $this->oFactory->enqueueStyles( array( dirname( __FILE__ ) . '/asset/css/test-style2.css' ) ); } /** * Triggered when the tab starts loading. * * @callback add_action load_{page slug}_{tab slug} */ public function replyToLoadTab( $oAdminPage ) {} /** * @param AdminPageFramework $oAdminPage */ public function replyToDoTab( $oAdminPage ) { ?>
This text should be red.
This text should be blue.
This text should be changed.
This text should be changed.