Admin Page Framework Documentation

Packages

  • AdminPageFramework
    • Common
      • Factory
      • Form
        • FieldType
      • Utility
    • Factory
      • AdminPage
      • MetaBox
      • NetworkAdmin
      • PageMetaBox
      • PostType
      • TaxonomyField
      • TermMeta
      • UserMeta
      • Widget
    • Utility

Classes

  • AdminPageFramework_PageMetaBox
  • AdminPageFramework_PageMetaBox_Controller

Resources

  • Tutorials
  • Support
  • Reporting Issues

Class AdminPageFramework_PageMetaBox

Provides methods for creating meta boxes in pages added by the framework.

Abstract
Package: AdminPageFramework\Factory\PageMetaBox
Since: 3.0.0
Located at factory/page_meta_box/AdminPageFramework_PageMetaBox.php

Methods summary

public
# __construct( string $sMetaBoxID, string $sTitle, array|string $asPageSlugs = array(), string $sContext = 'normal', string $sPriority = 'default', string $sCapability = 'manage_options', string $sTextDomain = 'admin-page-framework' )

Registers necessary hooks and internal properties.

Examples

new APF_MetaBox_For_Pages_Normal(
    'apf_metabox_for_pages_normal', // meta box id
    __( 'Sample Meta Box For Admin Pages Inserted in Normal Area' ), // title
    'apf_first_page', // page slugs
    'normal', // context
    'default' // priority
);
include( APFDEMO_DIRNAME . '/example/APF_MetaBox_For_Pages_Advanced.php' );
new APF_MetaBox_For_Pages_Advanced(
    'apf_metabox_for_pages_advanced', // meta box id
    __( 'Sample Meta Box For Admin Pages Inserted in Advanced Area' ), // title
    'apf_first_page', // page slugs
    'advanced', // context
    'default' // priority
);
include( APFDEMO_DIRNAME . '/example/APF_MetaBox_For_Pages_Side.php' );
new APF_MetaBox_For_Pages_Side(
    'apf_metabox_for_pages_side', // meta box id
    __( 'Sample Meta Box For Admin Pages Inserted in Advanced Area' ), // title
    array( 'apf_first_page', 'apf_second_page' ), // page slugs - setting multiple slugs is possible
    'side', // context
    'default' // priority
);

Parameters

$sMetaBoxID
string
$sMetaBoxID The meta box ID to be created.
$sTitle
string
$sTitle The meta box title.
$asPageSlugs
array|string
$asPageSlugs the page slug(s) that the meta box belongs to. If the element is an array, it will be considered as a tab array. $asPageSlugs = array( 'settings' => array( // if the key is not numeric and the value is an array, it will be considered as a tab array. 'help', // enabled in the tab whose slug is 'help' which belongs to the page whose slug is 'settings' 'about', // enabled in the tab whose slug is 'about' which belongs to the page whose slug is 'settings' 'general', // enabled in the tab whose slug is 'general' which belongs to the page whose slug is 'settings' ), 'manage', // if the numeric key with a string value is given, the condition applies to the page slug of this string value. );
$sContext
string
$sContext The context, either normal, advanced, or side.
$sPriority
string
$sPriority The priority, either high, core, default or low.
$sCapability
string
$sCapability The capability. See Roles and Capabilities.
$sTextDomain
string
$sTextDomain

Since

3.0.0

Overrides

AdminPageFramework_MetaBox_Model::__construct

Magic methods summary

Properties summary

Related

If you find undocumented functionality, please report it here.

Admin Page Framework