skipv1_0_0select
skip_select( $name, $elements, $args );.
Description
skip\v1_0_0\select( (string) $name, (array/string) $elements, (constant) $label = FALSE, (array) $args = array() );
Adding a select
field.
Default UsageThis will create an automated saved select
field with values 1 till 10
.
Parameters
$name
// (string) (required) The name of the field.
$elements
// (array/string) (required) The elements to show in Select
.
$args
// (array/string) (optional) Values for further settings.
$args
Settings
- id (string) ID if the HTML
Element
. - label (string) Label for
Element
. - default (string) Default Value if no Value is set before ('checked' if value have to be checked on default).
- classes (string) Name of CSS Classes which will be inserted into HTML seperated by empty space.
- before_element (string) Content before the element.
- after_element (string) Content after the element.
- save (boolean) TRUE if value of field have to be saved in Database, FALSE if not (default TRUE).
Example
Creating a select
field with values Opion 1 till 3 in a form.
skip_form_start( myformname );
$elements
= array(
array( label, => Option 1, value => 1 ),
array( label, => Option 2, value => 2 ),
array( label, => Option 3, value => 3 ),
);
$args
= array(
'id' = myelementid,
label, => Option
);
skip_select
( myselect
, $elements
, $args
);
skip_form_end(…);
Getting back the saved data.
$value
= skip_value( myformname , myselect
);
Parameters (4)
Usage
if ( !function_exists( 'skip\v1_0_0\select' ) ) { require_once ABSPATH . PLUGINDIR . 'facebook-fanpage-import/includes/skip/elements/forms/select.php'; } // The name of the checkbox field. $name = ''; // The elements to show in Select. $elements = null; // List of Arguments. $label = FALSE; // The args. $args = array(); // NOTICE! Understand what this does before running. $result = skip\v1_0_0\select($name, $elements, $label, $args);
Defined (1)
The function is defined in the following location(s).