(→Examples) |
|||
| Line 35: | Line 35: | ||
<syntaxhighlight>pl_add_options_page( array( 'name' => 'test', 'array' => $options, 'position' => 3 ) );</syntaxhighlight> | <syntaxhighlight>pl_add_options_page( array( 'name' => 'test', 'array' => $options, 'position' => 3 ) );</syntaxhighlight> | ||
| − | |||
==== Add menu with raw HTML ==== | ==== Add menu with raw HTML ==== | ||
pl_add_options_page adds a new tab to the main options area, with either HTML content or with an array of options.
$args
All examples will use the following basic array option
$options = array(
'foo_field' => array(
'default' => '',
'type' => 'text',
'title' => __('Foo', 'pagelines'),
'inputlabel'=> __('More Foo', 'pagelines'),
'shortexp' => __('Foo foo foo foo.', 'pagelines'),
),
);
This example will add a new menu tab called 'test' and use the $options array to populate it.
pl_add_options_page( array( 'name' => 'test', 'array' => $options ) );
pl_add_options_page( array( 'name' => 'test', 'array' => $options, 'position' => 3 ) );
pl_add_options_page( array( 'name' => 'test', 'raw' => 'hello
' ) );
pl_add_options_page( array( 'name' => 'test', 'raw' => $this->custom_html() ) );
Since 2.2
pl_add_options_page() is located in includes/library.layout.php