$oScreen
$oScreen : object
Stores the screen object.
Provides methods to render admin page elements.
finalizeInPageTabs() : void
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.
showPageHeadingTabs(boolean $fShow, string $strPageSlug)
Sets whether page-heading tabs are displayed or not.
$this->showPageHeadingTabs( false ); // disables the page heading tabs by passing false.
boolean | $fShow | If false, page-heading tabs will be disabled; otherwise, enabled. |
string | $strPageSlug | The page to apply the visibility setting. If not set, it applies to all the pages. |
showInPageTabs(boolean $fShow, string $strPageSlug)
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.
boolean | $fShow | If false, in-page tabs will be disabled. |
string | $strPageSlug | The page to apply the visibility setting. If not set, it applies to all the pages. |
setPageHeadingTabTag(string $strTag, string $strPageSlug)
Sets page-heading tab's HTML tag.
$this->setPageHeadingTabTag( 'h2' );
string | $strTag | The HTML tag that encloses the page-heading tab title. Default: h2. |
string | $strPageSlug | The page slug that applies the setting. |
addInPageTab(string $strPageSlug, string $strTabTitle, string $strTabSlug, integer $numOrder, boolean $fHide, string $strParentTabSlug) : void
Adds an in-page tab.
string | $strPageSlug | The page slug that the tab belongs to. |
string | $strTabTitle | The title of the tab. |
string | $strTabSlug | The tab slug. Non-alphabetical characters should not be used including dots(.) and hyphens(-). |
integer | $numOrder | ( optional ) the order number of the tab. The lager the number is, the lower the position it is placed in the menu. |
boolean | $fHide | ( optional ) 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. |
string | $strParentTabSlug | ( optional ) this needs to be set if the above fHide is true so that the parent tab will be emphasized as active when the hidden page is accessed. |
addInPageTabs(array $arrTab1, array $arrTab2, array $_and_more) : void
Adds in-page tabs.
The parameters accept in-page tab arrays and they must have the following array keys.
$this->addInPageTabs(
array(
'strTabSlug' => 'firsttab',
'strTitle' => __( 'Text Fields', 'my-text-domain' ),
'strPageSlug' => 'myfirstpage'
),
array(
'strTabSlug' => 'secondtab',
'strTitle' => __( 'Selectors and Checkboxes', 'my-text-domain' ),
'strPageSlug' => 'myfirstpage'
)
);
array | $arrTab1 | The in-page tab array. |
array | $arrTab2 | Another in-page tab array. |
array | $_and_more | Add in-page tab arrays as many as necessary to the next parameters. |
addHelpTab(array $arrHelpTab) : void
Adds the given contextual help tab contents into the property.
$this->addHelpTab(
array(
'strPageSlug' => 'first_page', // ( mandatory )
// 'strPageTabSlug' => null, // ( optional )
'strHelpTabTitle' => 'Admin Page Framework',
'strHelpTabID' => 'admin_page_framework', // ( mandatory )
'strHelpTabContent' => __( 'This contextual help text can be set with the addHelpTab() method.', 'admin-page-framework' ),
'strHelpTabSidebarContent' => __( 'This is placed in the sidebar of the help pane.', 'admin-page-framework' ),
)
);
array | $arrHelpTab | The help tab array. The key structure is explained in the description part. |
setHelpTab( $strID, $strTitle, $arrContents, $arrSideBarContents)
Sets the contextual help tab.
On contrary to other methods relating to contextual help tabs that just modify the class properties, this finalizes the help tab contents. In other words, the set values here will take effect.
$strID | ||
$strTitle | ||
$arrContents | ||
$arrSideBarContents |