Admin Page Framework Documentation

Packages

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

Classes

  • AdminPageFramework_MetaBox
  • AdminPageFramework_MetaBox_Controller
  • AdminPageFramework_MetaBox_View

Resources

  • Tutorials
  • Support
  • Reporting Issues

Class AdminPageFramework_MetaBox_Controller

Provides UI related methods.

Abstract
Package: AdminPageFramework\Factory\MetaBox
Since: 3.3.0
Located at factory/meta_box/AdminPageFramework_MetaBox_Controller.php

Methods summary

public
# setUp( )

The method for all necessary set-ups.

Example

 public function setUp() {
    $this->addSettingFields(
        array(
            'field_id'    => 'sample_metabox_text_field',
            'title'       => 'Text Input',
            'description' => 'The description for the field.',
            'type'        => 'text',
        ),
        array(
            'field_id'    => 'sample_metabox_textarea_field',
            'title'       => 'Textarea',
            'description' => 'The description for the field.',
            'type'        => 'textarea',
            'default'     => 'This is a default text value.',
        )
    );
}

Since

2.0.0

Remark

The user should override this method.

Overrides

AdminPageFramework_Factory_Controller::setUp
public string[]
# enqueueStyles( )

Enqueues styles by post type.

Returns

string[]
AN array holing the queued item handle IDs.

Since

3.0.0
3.8.31 Removed parameters to be compatible with the base class.
public string
# enqueueStyle( )

Enqueues a style by post type.

Returns

string
The script handle ID. If the passed url is not a valid url string, an empty string will be returned.

Since

3.0.0
3.8.31 Removed parameters to be compatible with the base class.

See

http://codex.wordpress.org/Function_Reference/wp_enqueue_style
public string[]
# enqueueScripts( )

Enqueues scripts by page slug and tab slug.

Returns

string[]
An array holding the queued item handle IDs.

Since

3.0.0
3.8.31 Removed parameters to be compatible with the base class.
public string
# enqueueScript( )

Enqueues a script by post type.

Example

$this->enqueueScript(
     plugins_url( 'asset/js/test.js' , __FILE__ ), // source url or path
     array( 'my_post_type_slug' ),
     array(
         'handle_id'     => 'my_script', // this handle ID also is used as the object name for the translation array below.
         'translation'   => array(
             'a'                 => 'hello world!',
             'style_handle_id'   => $sStyleHandle, // check the enqueued style handle ID here.
         ),
     )
);

Returns

string
The script handle ID. If the passed url is not a valid url string, an empty string will be returned.

Since

2.1.2
3.8.31 Removed parameters to be compatible with the base class.

See

http://codex.wordpress.org/Function_Reference/wp_enqueue_script

Magic methods summary

Properties summary

Related

Direct known subclasses

AdminPageFramework_MetaBox

If you find undocumented functionality, please report it here.

Admin Page Framework