initial commit
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/**
|
||||
* Redux Framework image select config.
|
||||
* For full documentation, please visit: http://devs.redux.io/
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
Redux::set_section(
|
||||
$opt_name,
|
||||
array(
|
||||
'title' => esc_html__( 'Image Select', 'your-textdomain-here' ),
|
||||
'id' => 'select-image_select',
|
||||
'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-fields/image-select.html" target="_blank">https://devs.redux.io/core-fields/image-select.html</a>',
|
||||
'subsection' => true,
|
||||
'fields' => array(
|
||||
array(
|
||||
'id' => 'opt-image-select-layout',
|
||||
'type' => 'image_select',
|
||||
'title' => esc_html__( 'Images Option for Layout', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This uses some of the built in images, you can use them for layout options.', 'your-textdomain-here' ),
|
||||
|
||||
// Must provide key => value(array:title|img) pairs for radio options.
|
||||
'options' => array(
|
||||
'1' => array(
|
||||
'alt' => '1 Column',
|
||||
'img' => Redux_Core::$url . 'assets/img/1col.png',
|
||||
),
|
||||
'2' => array(
|
||||
'alt' => '2 Column Left',
|
||||
'img' => Redux_Core::$url . 'assets/img/2cl.png',
|
||||
),
|
||||
'3' => array(
|
||||
'alt' => '2 Column Right',
|
||||
'img' => Redux_Core::$url . 'assets/img/2cr.png',
|
||||
),
|
||||
'4' => array(
|
||||
'alt' => '3 Column Middle',
|
||||
'img' => Redux_Core::$url . 'assets/img/3cm.png',
|
||||
),
|
||||
'5' => array(
|
||||
'alt' => '3 Column Left',
|
||||
'img' => Redux_Core::$url . 'assets/img/3cl.png',
|
||||
),
|
||||
'6' => array(
|
||||
'alt' => '3 Column Right',
|
||||
'img' => Redux_Core::$url . 'assets/img/3cr.png',
|
||||
),
|
||||
),
|
||||
'default' => '2',
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-patterns',
|
||||
'type' => 'image_select',
|
||||
'tiles' => true,
|
||||
'title' => esc_html__( 'Images Option (with tiles => true)', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'Select a background pattern.', 'your-textdomain-here' ),
|
||||
'default' => 0,
|
||||
'options' => $sample_patterns,
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-image-select',
|
||||
'type' => 'image_select',
|
||||
'title' => esc_html__( 'Images Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
|
||||
// Must provide key => value(array:title|img) pairs for radio options.
|
||||
'options' => array(
|
||||
'1' => array(
|
||||
'title' => 'Opt 1',
|
||||
'img' => admin_url() . 'images/align-none.png',
|
||||
),
|
||||
'2' => array(
|
||||
'title' => 'Opt 2',
|
||||
'img' => admin_url() . 'images/align-left.png',
|
||||
),
|
||||
'3' => array(
|
||||
'title' => 'Opt 3',
|
||||
'img' => admin_url() . 'images/align-center.png',
|
||||
),
|
||||
'4' => array(
|
||||
'title' => 'Opt 4',
|
||||
'img' => admin_url() . 'images/align-right.png',
|
||||
),
|
||||
),
|
||||
'default' => '2',
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-presets',
|
||||
'type' => 'image_select',
|
||||
'presets' => true,
|
||||
'full_width' => true,
|
||||
'title' => esc_html__( 'Preset', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'This allows you to set a json string or array to override multiple preferences in your theme.', 'your-textdomain-here' ),
|
||||
'default' => 0,
|
||||
'desc' => esc_html__( 'This allows you to set a json string or array to override multiple preferences in your theme.', 'your-textdomain-here' ),
|
||||
'options' => array(
|
||||
'1' => array(
|
||||
'alt' => 'Preset 1',
|
||||
'img' => Redux_Core::$url . '../sample/presets/preset1.png',
|
||||
'presets' => array(
|
||||
'switch-on' => 1,
|
||||
'switch-off' => 1,
|
||||
'switch-parent' => 1,
|
||||
),
|
||||
),
|
||||
'2' => array(
|
||||
'alt' => 'Preset 2',
|
||||
'img' => Redux_Core::$url . '../sample/presets/preset2.png',
|
||||
'presets' => '{"opt-slider-label":"1", "opt-slider-text":"10"}',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Silence is golden.
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
echo null;
|
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* Redux Framework select image config.
|
||||
* For full documentation, please visit: http://devs.redux.io/
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
Redux::set_section(
|
||||
$opt_name,
|
||||
array(
|
||||
'title' => esc_html__( 'Select Image', 'your-textdomain-here' ),
|
||||
'id' => 'select-select_image',
|
||||
'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-fields/select-image.html" target="_blank">https://devs.redux.io/core-fields/select-image.html</a>',
|
||||
'subsection' => true,
|
||||
'fields' => array(
|
||||
array(
|
||||
'id' => 'opt-select_image',
|
||||
'type' => 'select_image',
|
||||
'presets' => true,
|
||||
'title' => esc_html__( 'Select Image', 'your-textdomain-here' ),
|
||||
'options' => array(
|
||||
array(
|
||||
'alt' => 'Preset 1',
|
||||
'img' => Redux_Core::$url . '../sample/presets/preset1.png',
|
||||
'presets' => array(
|
||||
'switch-on' => 1,
|
||||
'switch-off' => 1,
|
||||
'switch-parent' => 1,
|
||||
),
|
||||
),
|
||||
array(
|
||||
'alt' => 'Preset 2',
|
||||
'img' => Redux_Core::$url . '../sample/presets/preset2.png',
|
||||
'presets' => '{"opt-slider-label":"1", "opt-slider-text":"10"}',
|
||||
),
|
||||
),
|
||||
'default' => Redux_Core::$url . '../sample/presets/preset2.png',
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-image',
|
||||
'type' => 'select_image',
|
||||
'title' => esc_html__( 'Select Image', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'A preview of the selected image will appear underneath the select box.', 'your-textdomain-here' ),
|
||||
'options' => $sample_patterns,
|
||||
'default' => Redux_Core::$url . '../sample/patterns/triangular.png',
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
@@ -0,0 +1,284 @@
|
||||
<?php
|
||||
/**
|
||||
* Redux Framework select config.
|
||||
* For full documentation, please visit: http://devs.redux.io/
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
Redux::set_section(
|
||||
$opt_name,
|
||||
array(
|
||||
'title' => esc_html__( 'Select', 'your-textdomain-here' ),
|
||||
'id' => 'select-select',
|
||||
'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-fields/select.html" target="_blank">https://devs.redux.io/core-fields/select.html</a>',
|
||||
'subsection' => true,
|
||||
'fields' => array(
|
||||
array(
|
||||
'id' => 'opt-select',
|
||||
'type' => 'select',
|
||||
'title' => esc_html__( 'Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
|
||||
// Must provide key => value pairs for select options.
|
||||
'options' => array(
|
||||
'1' => 'Opt 1',
|
||||
'2' => 'Opt 2',
|
||||
'3' => 'Opt 3',
|
||||
),
|
||||
'default' => '2',
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-stylesheet',
|
||||
'type' => 'select',
|
||||
'title' => esc_html__( 'Theme Stylesheet', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'Select your themes alternative color scheme.', 'your-textdomain-here' ),
|
||||
'options' => array(
|
||||
'default.css' => 'default.css',
|
||||
'color1.css' => 'color1.css',
|
||||
),
|
||||
'default' => 'default.css',
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-optgroup',
|
||||
'type' => 'select',
|
||||
'title' => esc_html__( 'Select Option with optgroup', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
|
||||
// Must provide key => value pairs for select options.
|
||||
'options' => array(
|
||||
'Group 1' => array(
|
||||
'1' => 'Opt 1',
|
||||
'2' => 'Opt 2',
|
||||
'3' => 'Opt 3',
|
||||
),
|
||||
'Group 2' => array(
|
||||
'4' => 'Opt 4',
|
||||
'5' => 'Opt 5',
|
||||
'6' => 'Opt 6',
|
||||
),
|
||||
'7' => 'Opt 7',
|
||||
'8' => 'Opt 8',
|
||||
'9' => 'Opt 9',
|
||||
),
|
||||
'default' => '2',
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-multi-select',
|
||||
'type' => 'select',
|
||||
'multi' => true,
|
||||
'title' => esc_html__( 'Multi Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
|
||||
// Must provide key => value pairs for radio options.
|
||||
'options' => array(
|
||||
'1' => 'Opt 1',
|
||||
'2' => 'Opt 2',
|
||||
'3' => 'Opt 3',
|
||||
),
|
||||
'default' => array( '2', '3' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-info',
|
||||
'type' => 'info',
|
||||
'desc' => esc_html__( 'You can easily add a variety of data from WordPress.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-categories',
|
||||
'type' => 'select',
|
||||
'data' => 'roles',
|
||||
'title' => esc_html__( 'Categories Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-categories-multi',
|
||||
'type' => 'select',
|
||||
'data' => 'categories',
|
||||
'multi' => true,
|
||||
'title' => esc_html__( 'Categories Multi Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-pages',
|
||||
'type' => 'select',
|
||||
'data' => 'pages',
|
||||
'title' => esc_html__( 'Pages Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-multi-select-pages',
|
||||
'type' => 'select',
|
||||
'data' => 'pages',
|
||||
'multi' => true,
|
||||
'title' => esc_html__( 'Pages Multi Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-tags',
|
||||
'type' => 'select',
|
||||
'data' => 'tags',
|
||||
'title' => esc_html__( 'Tags Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-multi-select-tags',
|
||||
'type' => 'select',
|
||||
'data' => 'terms',
|
||||
'multi' => true,
|
||||
'title' => esc_html__( 'Tags Multi Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-terms',
|
||||
'type' => 'select',
|
||||
'data' => 'terms',
|
||||
'title' => esc_html__( 'Terms Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-multi-select-terms',
|
||||
'type' => 'select',
|
||||
'data' => 'terms',
|
||||
'multi' => true,
|
||||
'title' => esc_html__( 'Terms Multi Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-menus',
|
||||
'type' => 'select',
|
||||
'data' => 'menus',
|
||||
'title' => esc_html__( 'Menus Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-multi-select-menus',
|
||||
'type' => 'select',
|
||||
'data' => 'menu',
|
||||
'multi' => true,
|
||||
'title' => esc_html__( 'Menus Multi Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-post-type',
|
||||
'type' => 'select',
|
||||
'data' => 'post_type',
|
||||
'title' => esc_html__( 'Post Type Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-multi-select-post-type',
|
||||
'type' => 'select',
|
||||
'data' => 'post_type',
|
||||
'multi' => true,
|
||||
'title' => esc_html__( 'Post Type Multi Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-multi-select-sortable',
|
||||
'type' => 'select',
|
||||
'data' => 'post_type',
|
||||
'multi' => true,
|
||||
'sortable' => true,
|
||||
'title' => esc_html__( 'Post Type Multi Select Option + Sortable', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'This field also has sortable enabled!', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-posts',
|
||||
'type' => 'select',
|
||||
'data' => 'post',
|
||||
'title' => esc_html__( 'Posts Select Option2', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-multi-select-posts',
|
||||
'type' => 'select',
|
||||
'data' => 'post',
|
||||
'multi' => true,
|
||||
'title' => esc_html__( 'Posts Multi Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-roles',
|
||||
'type' => 'select',
|
||||
'data' => 'roles',
|
||||
'title' => esc_html__( 'User Role Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-capabilities',
|
||||
'type' => 'select',
|
||||
'data' => 'capabilities',
|
||||
'multi' => false,
|
||||
'ajax' => true,
|
||||
'min_input_length' => 3,
|
||||
'title' => esc_html__( 'Capabilities Select Option w/ AJAX Loading', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-elusive',
|
||||
'type' => 'select',
|
||||
'data' => 'elusive-icons',
|
||||
'title' => esc_html__( 'Elusive Icons Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'Here\'s a list of all the elusive icons by name and icon.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-users',
|
||||
'type' => 'select',
|
||||
'data' => 'users',
|
||||
'ajax' => true,
|
||||
'min_input_length' => 3,
|
||||
'title' => esc_html__( 'Users Select Option', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'opt-select-callback',
|
||||
'type' => 'select',
|
||||
'data' => 'callback',
|
||||
'args' => 'redux_select_callback',
|
||||
'title' => esc_html__( 'Select Option using a Callback', 'your-textdomain-here' ),
|
||||
'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ),
|
||||
'desc' => esc_html__( 'The items in this select were added via a callback function.', 'your-textdomain-here' ),
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Select callback function.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function redux_select_callback(): array {
|
||||
$options = array();
|
||||
|
||||
$options[0] = esc_html__( 'Zero', 'your-textdomain-here' );
|
||||
$options[1] = esc_html__( 'One', 'your-textdomain-here' );
|
||||
$options[2] = esc_html__( 'Two', 'your-textdomain-here' );
|
||||
$options[3] = esc_html__( 'Three', 'your-textdomain-here' );
|
||||
|
||||
return $options;
|
||||
}
|
Reference in New Issue
Block a user