array( '#menu-posts-apf_posts > a', // '#button-deactivate-demo', // multiple targets can be set with an array ), 'options' => array( 'content' => sprintf( '
%2$s
', __( 'Admin Page Framework Demo' ,'admin-page-framework-loader '), __( 'Check out the functionality of Admin Page Framework.','admin-page-framework-loader' ) ), 'position' => array( 'edge' => 'left', 'align' => 'middle' ) ) ) ); } /** * Sets up pages. * * (Required) In this `setUp()` method, you will define admin pages. * * @callback action wp_loaded * @return void */ public function setUp() { // (optional) this can be set via the constructor. For available values, see https://codex.wordpress.org/Roles_and_Capabilities. $this->setCapability( 'read' ); // (required) Set the root page. $this->setRootMenuPageBySlug( 'edit.php?post_type=' . AdminPageFrameworkLoader_Registry::$aPostTypes['demo'] ); /** * (optional) Add links in the plugin listing table. ( .../wp-admin/plugins.php ) */ /* $this->addLinkToPluginDescription( "Donate", "Repository" ); $this->addLinkToPluginTitle( "miunosoft" ); $this->setPluginSettingsLinkLabel( __( 'Built-in Field Types', 'admin-page-framework-loader' ) ); */ // Disable the action link in the plugin listing table. $this->setPluginSettingsLinkLabel( '' ); // Add pages - below classes do not extend the framework factory class but uses the framework hooks to add pages. new APF_Demo_BuiltinFieldType; new APF_Demo_AdvancedUsage; new APF_Demo_CustomFieldType; new APF_Demo_PageMetaBox; new APF_Demo_ManageOptions; new APF_Demo_HiddenPage; new APF_Demo_Contact; new APF_Demo_Test; // Add an external link. $this->addSubMenuItem( array( 'href' => 'http://admin-page-framework.michaeluno.jp/en/v3/package-AdminPageFramework.AdminPage.html', 'title' => __( 'Documentation', 'admin-page-framework-loader' ), 'order' => 60, ) ); } /** * Called when the admin pages added with this class get loaded. * * Do some set-ups common in all the added pages and tabs. * * Alternatively you can use load_{instantiated class name} hook. * @return void */ public function load() { // Disable the page heading tabs by passing false. $this->setPageHeadingTabsVisibility( false ); // Set the tag used for in-page tabs. $this->setInPageTabTag( 'h2' ); // Used to insert PHP code in example fields. $this->oWPRMParser = new AdminPageFramework_WPReadmeParser; } /* * Built-in Field Types Page * * @callback action do_{page slug} * */ public function do_apf_builtin_field_types() { if ( isset( $_GET[ 'tab' ] ) && 'system' === $_GET[ 'tab' ] ) { return; } submit_button(); } /** * Modifies the left footer text. * * @callback filter footer_left_{class name} */ public function footer_left_APF_DEMO( $sHTML ) { return "" . sprintf( __( 'Custom text inserted with the%1$s filter.', 'admin-page-framework-loader' ),
'footer_left_{class name}'
)
. "%1$s filter.', 'admin-page-framework-loader' ),
'footer_right_{class name}'
)
. "%1$s filter.', 'admin-page-framework-loader' ),
'footer_left_{page slug}'
)
. "%1$s filter.', 'admin-page-framework-loader' ),
'footer_right_{page slug}'
)
. "