_sClassName, array( $this, 'replyToSetUpPages' ) ); } /** * Sets up pages. * * @callback action set_up_{instantiated class name} */ public function replyToSetUpPages( $oFactory ) { // ( required ) Add sub-menu items (pages or links) $oFactory->addSubMenuItems( array( 'title' => __( 'Sample Page', 'admin-page-framework-loader' ), 'page_slug' => 'apf_sample_page', 'screen_icon' => AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/image/wp_logo_bw_32x32.png', // ( for WP v3.7.1 or below ) the icon _file path_ can be used ), array( 'title' => __( 'Hidden Page', 'admin-page-framework-loader' ), 'page_slug' => 'apf_hidden_page', 'screen_icon' => version_compare( $GLOBALS[ 'wp_version' ], '3.8', '<' ) ? AdminPageFrameworkLoader_Registry::getPluginURL( 'asset/image/wp_logo_bw_32x32.png', AdminPageFrameworkLoader_Registry::$sFilePath ) : null, // ( for WP v3.7.1 or below ) 'show_in_menu' => false, ) ); add_action( "load_" . "apf_sample_page", array( $this, 'replyToLoadPage' ) ); add_action( "load_" . "apf_hidden_page", array( $this, 'replyToLoadPage' ) ); add_action( "do_" . "apf_sample_page", array( $this, 'replyToModifySamplePage' ) ); add_action( "do_" . "apf_hidden_page", array( $this, 'replyToModifyHiddenPage' ) ); } /** * Called when the page starts loading. * * @callback action load_{page slug} */ public function replyToLoadPage( $oFactory ) { $oFactory->setPageTitleVisibility( true ); $oFactory->setPageHeadingTabsVisibility( false ); } /* * The sample page and the hidden page. * * @callback action do_{page slug} */ public function replyToModifySamplePage( $oFactory ) { echo "

" . __( 'This is a sample page that has a link to a hidden page created by the framework.', 'admin-page-framework-loader' ) . "

"; $_sLinkToHiddenPage = esc_url( $oFactory->oUtil->getQueryAdminURL( array( 'page' => 'apf_hidden_page' ) ) ); echo "" . __( 'Go to Hidden Page', 'admin-page-framework-loader' ). ""; } /** * @callback action do_{page slug} */ public function replyToModifyHiddenPage( $oFactory ) { echo "

" . __( 'This is a hidden page.', 'admin-page-framework-loader' ) . "

"; echo "

" . __( 'It is useful when you have a setting page that requires a proceeding page.', 'admin-page-framework-loader' ) . "

"; $_sLinkToGoBack = esc_url( $oFactory->oUtil->getQueryAdminURL( array( 'page' => 'apf_sample_page' ) ) ); echo "" . __( 'Go Back', 'admin-page-framework-loader' ). ""; } }