Class AdminPageFramework_Page
Provides methods to render admin page elements.
-
AdminPageFramework_Factory_Router
-
AdminPageFramework_Factory_Model
-
AdminPageFramework_Factory_View
-
AdminPageFramework_Factory_Controller
-
AdminPageFramework_Factory
-
AdminPageFramework_Base
-
AdminPageFramework_Page_MetaBox
-
AdminPageFramework_Page
Abstract
Package: AdminPageFramework\
Page
Since:
2.0.0
Since:
2.1.0 Extends AdminPageFramework_HelpPane_Page.
Since:
3.0.0 No longer extends AdminPageFramework_HelpPane_Page.
Extends:
AdminPageFramework_Page_MetaBox
Located at factory/AdminPageFramework/AdminPageFramework_Page.php
Methods summary
public
|
#
addInPageTabs( array $aTab1, array $aTab2 = null, array $_and_more = null )
Adds in-page tabs.
The parameters accept in-page tab arrays and they must have the following
array keys.
Example
$this->addInPageTabs(
array(
'page_slug' => 'myfirstpage'
'tab_slug' => 'firsttab',
'title' => __( 'Text Fields', 'my-text-domain' ),
),
array(
'page_slug' => 'myfirstpage'
'tab_slug' => 'secondtab',
'title' => __( 'Selectors and Checkboxes', 'my-text-domain' ),
)
);
$this->addInPageTabs(
'myfirstpage',
array(
'tab_slug' => 'firsttab',
'title' => __( 'Text Fields', 'my-text-domain' ),
),
array(
'tab_slug' => 'secondtab',
'title' => __( 'Selectors and Checkboxes', 'my-text-domain' ),
)
);
Parameters
- $aTab1
array $aTab1 The in-page tab array.
In-Page Tab Array
- page_slug - ( string ) the page slug that the tab belongs
to.
- tab_slug - ( string ) the tab slug. Non-alphabetical
characters should not be used including dots(.) and hyphens(-).
- title - ( string ) the title of the tab.
- order - ( optional, integer ) the order number of the tab.
The lager the number is, the lower the position it is placed in the menu.
- show_in_page_tab - ( optional, boolean ) default: false. If
this is set to false, the tab title will not be displayed in the tab navigation
menu; however, it is still accessible from the direct URL.
- parent_tab_slug - ( optional, string ) this needs to be set
if the above show_in_page_tab is true so that the parent tab will be emphasized
as active when the hidden page is accessed.
- $aTab2
array $aTab2 Another in-page tab array.
- $_and_more
array $_and_more Add in-page tab arrays as many as necessary to the next parameters.
Since
2.0.0
3.0.0 Changed the scope to public. Added page slug target support.
Remark
Accepts variadic parameters; the number of accepted parameters are not limited
to three.
In-page tabs are different from page-heading tabs which is automatically added
with page titles.
Overrides
AdminPageFramework_Base::addInPageTabs
|
public
|
#
addInPageTab( array|string $asInPageTab )
Adds an in-page tab.
The singular form of the addInPageTabs() method, which takes only one
parameter.
Parameters
- $asInPageTab
array|string $asInPageTab The in-page tab array or the target page slug. If the target page
slug is set, the page_slug key can be omitted from next calls.
Since
2.0.0
3.0.0 Changed the scope to public.
Remark
Use this method to add in-page tabs to ensure the array holds all the necessary
keys.
In-page tabs are different from page-heading tabs which are automatically added
with page titles.
Overrides
AdminPageFramework_Base::addInPageTab
|
public
|
#
setPageTitleVisibility( boolean $bShow = true, mixed $sPageSlug = '' )
Sets whether the page title is displayed or not.
Sets whether the page title is displayed or not.
Example
$this->setPageTitleVisibility( false );
Parameters
- $bShow
boolean $bShow If false, the page title will not be displayed.
- $sPageSlug
Since
2.0.0
3.0.0 Changed the scope to public.
Overrides
AdminPageFramework_Base::setPageTitleVisibility
|
public
|
#
setPageHeadingTabsVisibility( boolean $bShow = true, string $sPageSlug = '' )
Sets whether page-heading tabs are displayed or not.
Sets whether page-heading tabs are displayed or not.
Example
$this->setPageHeadingTabsVisibility( false );
Parameters
- $bShow
boolean $bShow If false, page-heading tabs will be disabled; otherwise, enabled.
- $sPageSlug
string $sPageSlug The page to apply the visibility setting. If not set, it applies to
all the pages.
Since
2.0.0
3.0.0 Changed the scope to public.
Remark
Page-heading tabs and in-page tabs are different. The former displays page
titles and the latter displays tab titles.
If the second parameter is omitted, it sets the default value.
Overrides
AdminPageFramework_Base::setPageHeadingTabsVisibility
|
public
|
#
setInPageTabsVisibility( boolean $bShow = true, string $sPageSlug = '' )
Sets whether in-page tabs are displayed or not.
Sets whether in-page tabs are displayed or not.
Sometimes, it is required to disable in-page tabs in certain pages. In that
case, use the second parameter.
Parameters
- $bShow
boolean $bShow If false, in-page tabs will be disabled.
- $sPageSlug
string $sPageSlug The page to apply the visibility setting. If not set, it applies to
all the pages.
Since
2.1.1
3.0.0 Changed the scope to public. Changed the name from showInPageTabs() to
setInPageTabsVisibility().
Remark
If the second parameter is omitted, it sets the default value.
Overrides
AdminPageFramework_Base::setInPageTabsVisibility
|
public
|
#
setInPageTabTag( string $sTag = 'h3', string $sPageSlug = '' )
Sets in-page tab's HTML tag.
Sets in-page tab's HTML tag.
Example
$this->setInPageTabTag( 'h2' );
Parameters
- $sTag
string $sTag The HTML tag that encloses each in-page tab title. Default: h3.
- $sPageSlug
string $sPageSlug The page slug that applies the setting.
Since
2.0.0
3.0.0 Changed the scope to public.
Remark
If the second parameter is omitted, it sets the default value.
Overrides
AdminPageFramework_Base::setInPageTabTag
|
public
|
#
setPageHeadingTabTag( string $sTag = 'h2', string $sPageSlug = '' )
Sets page-heading tab's HTML tag.
Sets page-heading tab's HTML tag.
Example
$this->setPageHeadingTabTag( 'h2' );
Parameters
- $sTag
string $sTag The HTML tag that encloses the page-heading tab title. Default: h2.
- $sPageSlug
string $sPageSlug The page slug that applies the setting.
Since
2.1.2
3.0.0 Changed the scope to public.
Remark
If the second parameter is omitted, it sets the default value.
Overrides
AdminPageFramework_Base::setPageHeadingTabTag
|
public
|
#
_replyToFinalizeInPageTabs( )
Finalizes the in-page tab property array.
Finalizes the in-page tab property array.
This finalizes the added in-page tabs and sets the default in-page tab for
each page. Also this sorts the in-page tab property array. This must be done
before registering settings sections because the default tab needs to be
determined in the process.
Since
2.0.0
Remark
A callback for the admin_menu hook. It must be called earlier than
_replyToRegisterSettings() method.
|
Methods inherited from AdminPageFramework_Page_MetaBox
__construct()
,
_getNumberOfColumns()
,
_printMetaBox()
,
_replyToAddMetaboxScript()
,
_replyToEnableMetaBox()
,
_replyToReturnDefaultNumberOfScreenColumns()
,
_replyToSetNumberOfScreenLayoutColumns()
Methods inherited from AdminPageFramework_Base
__call()
,
_doPageLoadCall()
,
_isInThePage()
,
_isInstantiatable()
,
_sortByOrder()
,
addHelpTab()
,
addLinkToPluginDescription()
,
addLinkToPluginTitle()
,
addSettingField()
,
addSettingFields()
,
addSettingSection()
,
addSettingSections()
,
addSubMenuItem()
,
addSubMenuItems()
,
addSubMenuLink()
,
addSubMenuPage()
,
addSubMenuPages()
,
enqueueScript()
,
enqueueScripts()
,
enqueueStyle()
,
enqueueStyles()
,
getFieldValue()
,
removeSettingFields()
,
removeSettingSections()
,
setAdminNotice()
,
setCapability()
,
setDisallowedQueryKeys()
,
setFooterInfoLeft()
,
setFooterInfoRight()
,
setRootMenuPage()
,
setRootMenuPageBySlug()
,
setUp()
addHelpText()
,
hasSettingNotice()
,
setFieldErrors()
,
setSettingNotice()
Methods inherited from AdminPageFramework_Factory_View
_replyToGetFieldOutput()
,
_replyToPrintSettingNotice()
_setUp()
Methods inherited from AdminPageFramework_Factory_Router
__get()
,
_getFormInstance()
,
_getHeadTagInstance()
,
_getHelpPaneInstance()
,
_getLinkInstancce()
,
_getPageLoadInfoInstance()
,
_replyToLoadComponents()
Magic methods summary
Properties summary
Properties inherited from AdminPageFramework_Base
$_aHookPrefixes
,
$oProp