Display a single select drop down box containing existing pages.

Option Details & Parameters

Type: select-pages

Returns: string

Can be placed in: Admin Panels , Admin Tabs , Meta Boxes , Theme Customizer

Parameter Type Description
name string The name of the option, for display purposes only.
id string A unique ID for this option. This ID will be used to get the value for this option.
desc string The description to display together with this option.
default string (Optional) The default page ID for this option. Defaults to 0, nothing selected.
livepreview string (Optional) jQuery code that updates something in your site in the live preview. Only used when the option is placed in a theme customizer section. Refer to Livepreview for more information on this parameter.


Creating a text option:

$panel->createOption( array(
      'name' => 'My Select Page Option',
      'id' => 'my_selectpage_option',
      'type' => 'select-pages',
      'desc' => 'Select a page'
) );