(→Add to existing menus with positioning) |
|||
| (8 intermediate revisions by one user not shown) | |||
| Line 1: | Line 1: | ||
| − | == | + | __NOTOC__ |
| − | + | == Function == | |
| + | <tt>pl_global_option</tt> adds an option or array of options into the main global PageLines Settings area. | ||
== Usage == | == Usage == | ||
| − | |||
<syntaxhighlight><?php pl_global_option( $args ) ?></syntaxhighlight> | <syntaxhighlight><?php pl_global_option( $args ) ?></syntaxhighlight> | ||
| + | |||
== Parameters == | == Parameters == | ||
'''$args''' | '''$args''' | ||
| Line 33: | Line 34: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
pl_global_option( array( 'menu' => 'website_setup', 'options' => $options, 'location' => 'top' ) );</syntaxhighlight> | pl_global_option( array( 'menu' => 'website_setup', 'options' => $options, 'location' => 'top' ) );</syntaxhighlight> | ||
| − | |||
<syntaxhighlight>pl_global_option( array( 'menu' => 'website_setup', 'options' => $options, 'location' => 'bottom' ) );</syntaxhighlight> | <syntaxhighlight>pl_global_option( array( 'menu' => 'website_setup', 'options' => $options, 'location' => 'bottom' ) );</syntaxhighlight> | ||
| Line 40: | Line 40: | ||
<syntaxhighlight>pl_global_option( array( 'menu' => 'website_setup', 'options' => $options, 'location' => 'before', 'option' => 'pagelines_favicon' ) );</syntaxhighlight> | <syntaxhighlight>pl_global_option( array( 'menu' => 'website_setup', 'options' => $options, 'location' => 'before', 'option' => 'pagelines_favicon' ) );</syntaxhighlight> | ||
| + | |||
| + | == Resources == | ||
| + | * Uses <tt>global array</tt> [[pagelines_add_global_option|$pagelines_add_global_option]] | ||
| + | * Uses WordPress [http://codex.wordpress.org/Function_Reference/wp_parse_args wp_parse_args] | ||
| + | |||
| + | == Changelog == | ||
| + | ''Since 2.2'' | ||
== Source File == | == Source File == | ||
<tt>pl_global_option()</tt> is located in [http://phpxref.pagelines.com/nav.html?includes/library.layout.php.source.html includes/library.layout.php] | <tt>pl_global_option()</tt> is located in [http://phpxref.pagelines.com/nav.html?includes/library.layout.php.source.html includes/library.layout.php] | ||
| + | |||
| + | ---- | ||
| + | |||
| + | [[Category:Draft]] | ||
| + | [[Category:New Page]] | ||
| + | [[Category:Functions]] | ||
pl_global_option adds an option or array of options into the main global PageLines Settings area.
$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 Custom menus and use the $options array to populate it.
pl_global_option( array( 'options' => $options ) );
pl_global_option( array( 'menu' => 'website_setup', 'options' => $options, 'location' => 'top' ) );
pl_global_option( array( 'menu' => 'website_setup', 'options' => $options, 'location' => 'bottom' ) );
pl_global_option( array( 'menu' => 'website_setup', 'options' => $options, 'location' => 'before', 'option' => 'pagelines_favicon' ) );
Since 2.2
pl_global_option() is located in includes/library.layout.php