Pl global option

[edit] Please Note

These docs are now deprecated, we have a new Support area located here

(Difference between revisions)
(Add to existing menus with positioning)
 
(8 intermediate revisions by one user not shown)
Line 1: Line 1:
== Description ==
+
__NOTOC__
Adds an option or array of options into the main global PageLines Settings area.
+
== 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]]

Latest revision as of 19:32, 26 March 2012

Function

pl_global_option adds an option or array of options into the main global PageLines Settings area.

Usage

Parameters

$args

  • menu - Menu slug.
  • options - Array
  • location - string - top|bottom|before|after
  • option - string - Which option to be before/after if location is set.

Examples

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'),
	),
);

Defaults

This example will add a new Custom menus and use the $options array to populate it.

pl_global_option( array( 'options' => $options ) );

Add to existing menus with positioning

pl_global_option( array( 'menu' => 'website_setup', 'options' => $options, 'location' => 'top' ) );
pl_global_option( array( 'menu' => 'website_setup', 'options' => $options, 'location' => 'bottom' ) );

Add to existing menus before a setting

pl_global_option( array( 'menu' => 'website_setup', 'options' => $options, 'location' => 'before', 'option' => 'pagelines_favicon' ) );

Resources

Changelog

Since 2.2

Source File

pl_global_option() is located in includes/library.layout.php