_oFactory = $oFactory; $this->_sClassName = $oFactory->oProp->sClassName; $this->_sPageSlug = $sPageSlug; $this->_oFactory->addInPageTabs( $this->_sPageSlug, // target page slug array( 'tab_slug' => $this->_sTabSlug, 'title' => __( 'Saved Data', 'admin-page-framework-loader' ), ) ); // load + page slug + tab slug add_action( 'load_' . $this->_sPageSlug . '_' . $this->_sTabSlug, array( $this, 'replyToLoadTab' ) ); } /** * Triggered when the tab is loaded. */ public function replyToLoadTab( $oFactory ) { add_action( 'do_' . $this->_sPageSlug . '_' . $this->_sTabSlug, array( $this, 'replyToDoTab' ) ); } public function replyToDoTab() { ?>
get_option() function. The key is the instantiated class name by default unless it is specified in the constructor. In this demo plugin, %1$s, is used as the option key.', 'admin-page-framework-loader' ), $this->_oFactory->oProp->sOptionKey );
echo ' ' . sprintf( __( 'It is stored in the $this->oProp-sOptionKey class property so you may access it directly to confirm the value. So the required code would be get_option( %1$s );.', 'admin-page-framework-loader' ), $this->_oFactory->oProp->sOptionKey );
echo ' ' . __( 'If you are retrieving them within the framework class, simply call $this->oProp->aOptions.', 'admin-page-framework-loader' );
?>
AdminPageFramework::getOption() static method. This allows you to retrieve the array element by specifying the option key and the array key (field id or section id).', 'admin-page-framework-loader' );
echo ' ' . __( 'Pass the option key to the first parameter and an array representing the dimensional keys to the second parameter', 'admin-page-framework-loader' );
echo ' ' . __( '$aData = AdminPageFramework::getOption( \'APF_Demo\', array( \'text_fields\', \'text\' ), \'default value\' ); will retrieve the option array value of $aArray[\'text_field\'][\'text\'].', 'admin-page-framework-loader' );
echo ' ' . __( 'This method is merely to avoid multiple uses of isset() to prevent PHP warnings.', 'admin-page-framework-loader' );
echo ' ' . __( 'So if you already know how to retrieve a value of an array element, you don\'t have to use it.', 'admin-page-framework-loader' ); // ' syntax fixer
?>