@@ -10,46 +10,46 @@ |
||
| 10 | 10 | defined( 'ABSPATH' ) || exit; |
| 11 | 11 | |
| 12 | 12 | Redux::set_section( |
| 13 | - $opt_name, |
|
| 14 | - array( |
|
| 15 | - 'title' => esc_html__( 'JS Button', 'your-textdomain-here' ), |
|
| 16 | - 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-extensions/js-button.html" target="_blank">https://devs.redux.io/core-extensions/js-button.html</a>', |
|
| 17 | - 'subsection' => true, |
|
| 18 | - 'fields' => array( |
|
| 19 | - array( |
|
| 20 | - 'id' => 'opt-js-button', |
|
| 21 | - 'type' => 'js_button', |
|
| 22 | - 'title' => esc_html__( 'JS Button', 'your-textdomain-here' ), |
|
| 23 | - 'subtitle' => esc_html__( 'Run javascript in the options panel from button clicks.', 'your-textdomain-here' ), |
|
| 24 | - 'desc' => esc_html__( 'Click the Add Date button to add the current date into the text field below.', 'your-textdomain-here' ), |
|
| 25 | - 'script' => array( |
|
| 26 | - 'url' => plugins_url( '/extensions/js-button.js', __DIR__ ), |
|
| 27 | - 'dir' => __DIR__ . '/js-button.js', |
|
| 28 | - 'dep' => array( 'jquery' ), |
|
| 29 | - 'ver' => time(), |
|
| 30 | - 'in_footer' => true, |
|
| 31 | - ), |
|
| 32 | - 'buttons' => array( |
|
| 33 | - array( |
|
| 34 | - 'text' => esc_html__( 'Add Date', 'your-textdomain-here' ), |
|
| 35 | - 'class' => 'button-primary', |
|
| 36 | - 'function' => 'redux_add_date', |
|
| 37 | - ), |
|
| 38 | - array( |
|
| 39 | - 'text' => esc_html__( 'Alert', 'your-textdomain-here' ), |
|
| 40 | - 'class' => 'button-secondary', |
|
| 41 | - 'function' => 'redux_show_alert', |
|
| 42 | - ), |
|
| 13 | + $opt_name, |
|
| 14 | + array( |
|
| 15 | + 'title' => esc_html__( 'JS Button', 'your-textdomain-here' ), |
|
| 16 | + 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-extensions/js-button.html" target="_blank">https://devs.redux.io/core-extensions/js-button.html</a>', |
|
| 17 | + 'subsection' => true, |
|
| 18 | + 'fields' => array( |
|
| 19 | + array( |
|
| 20 | + 'id' => 'opt-js-button', |
|
| 21 | + 'type' => 'js_button', |
|
| 22 | + 'title' => esc_html__( 'JS Button', 'your-textdomain-here' ), |
|
| 23 | + 'subtitle' => esc_html__( 'Run javascript in the options panel from button clicks.', 'your-textdomain-here' ), |
|
| 24 | + 'desc' => esc_html__( 'Click the Add Date button to add the current date into the text field below.', 'your-textdomain-here' ), |
|
| 25 | + 'script' => array( |
|
| 26 | + 'url' => plugins_url( '/extensions/js-button.js', __DIR__ ), |
|
| 27 | + 'dir' => __DIR__ . '/js-button.js', |
|
| 28 | + 'dep' => array( 'jquery' ), |
|
| 29 | + 'ver' => time(), |
|
| 30 | + 'in_footer' => true, |
|
| 31 | + ), |
|
| 32 | + 'buttons' => array( |
|
| 33 | + array( |
|
| 34 | + 'text' => esc_html__( 'Add Date', 'your-textdomain-here' ), |
|
| 35 | + 'class' => 'button-primary', |
|
| 36 | + 'function' => 'redux_add_date', |
|
| 37 | + ), |
|
| 38 | + array( |
|
| 39 | + 'text' => esc_html__( 'Alert', 'your-textdomain-here' ), |
|
| 40 | + 'class' => 'button-secondary', |
|
| 41 | + 'function' => 'redux_show_alert', |
|
| 42 | + ), |
|
| 43 | 43 | |
| 44 | - ), |
|
| 45 | - ), |
|
| 46 | - array( |
|
| 47 | - 'id' => 'opt-blank-text', |
|
| 48 | - 'type' => 'text', |
|
| 49 | - 'title' => esc_html__( 'Date', 'your-textdomain-here' ), |
|
| 50 | - 'subtitle' => esc_html__( 'Click the Add Date button above to fill out this field.', 'your-textdomain-here' ), |
|
| 51 | - ), |
|
| 52 | - ), |
|
| 53 | - ) |
|
| 44 | + ), |
|
| 45 | + ), |
|
| 46 | + array( |
|
| 47 | + 'id' => 'opt-blank-text', |
|
| 48 | + 'type' => 'text', |
|
| 49 | + 'title' => esc_html__( 'Date', 'your-textdomain-here' ), |
|
| 50 | + 'subtitle' => esc_html__( 'Click the Add Date button above to fill out this field.', 'your-textdomain-here' ), |
|
| 51 | + ), |
|
| 52 | + ), |
|
| 53 | + ) |
|
| 54 | 54 | ); |
| 55 | 55 | // phpcs:enable |
@@ -11,27 +11,27 @@ |
||
| 11 | 11 | defined( 'ABSPATH' ) || exit; |
| 12 | 12 | |
| 13 | 13 | Redux::set_section( |
| 14 | - $opt_name, |
|
| 15 | - array( |
|
| 16 | - 'title' => esc_html__( 'Custom Fonts', 'your-textdomain-here' ), |
|
| 17 | - 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-extensions/custom-fonts.html" target="_blank">https://devs.redux.io/core-extensions/custom-fonts.html</a>', |
|
| 18 | - 'subsection' => true, |
|
| 19 | - 'fields' => array( |
|
| 20 | - array( |
|
| 21 | - 'id' => 'custom_fonts', |
|
| 22 | - 'type' => 'custom_fonts', |
|
| 23 | - ), |
|
| 24 | - array( |
|
| 25 | - 'id' => 'custom_fonts_typography', |
|
| 26 | - 'type' => 'typography', |
|
| 27 | - 'title' => esc_html__( 'Custom Fonts Typography', 'your-textdomain-here' ), |
|
| 28 | - 'subtitle' => 'This will modify the font family of the .entry-title classes.', |
|
| 29 | - 'output' => '.site-title, .widget-title, .entry-title, .wp-block-site-title', |
|
| 30 | - 'font-size' => false, |
|
| 31 | - 'line-height' => false, |
|
| 32 | - 'text-align' => false, |
|
| 33 | - ), |
|
| 34 | - ), |
|
| 35 | - ) |
|
| 14 | + $opt_name, |
|
| 15 | + array( |
|
| 16 | + 'title' => esc_html__( 'Custom Fonts', 'your-textdomain-here' ), |
|
| 17 | + 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-extensions/custom-fonts.html" target="_blank">https://devs.redux.io/core-extensions/custom-fonts.html</a>', |
|
| 18 | + 'subsection' => true, |
|
| 19 | + 'fields' => array( |
|
| 20 | + array( |
|
| 21 | + 'id' => 'custom_fonts', |
|
| 22 | + 'type' => 'custom_fonts', |
|
| 23 | + ), |
|
| 24 | + array( |
|
| 25 | + 'id' => 'custom_fonts_typography', |
|
| 26 | + 'type' => 'typography', |
|
| 27 | + 'title' => esc_html__( 'Custom Fonts Typography', 'your-textdomain-here' ), |
|
| 28 | + 'subtitle' => 'This will modify the font family of the .entry-title classes.', |
|
| 29 | + 'output' => '.site-title, .widget-title, .entry-title, .wp-block-site-title', |
|
| 30 | + 'font-size' => false, |
|
| 31 | + 'line-height' => false, |
|
| 32 | + 'text-align' => false, |
|
| 33 | + ), |
|
| 34 | + ), |
|
| 35 | + ) |
|
| 36 | 36 | ); |
| 37 | 37 | // phpcs:enable |
@@ -10,111 +10,111 @@ |
||
| 10 | 10 | defined( 'ABSPATH' ) || exit; |
| 11 | 11 | |
| 12 | 12 | Redux::set_section( |
| 13 | - $opt_name, |
|
| 14 | - array( |
|
| 15 | - 'title' => esc_html__( 'Field Required / Linking', 'your-textdomain-here' ), |
|
| 16 | - 'id' => 'required', |
|
| 17 | - 'desc' => esc_html__( 'For full documentation on validation, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/configuration/fields/required.html" target="_blank">https://devs.redux.io/configuration/fields/required.html</a>', |
|
| 18 | - 'subsection' => true, |
|
| 19 | - 'fields' => array( |
|
| 20 | - array( |
|
| 21 | - 'id' => 'opt-required-basic', |
|
| 22 | - 'type' => 'switch', |
|
| 23 | - 'title' => esc_html__( 'Basic Required Example', 'your-textdomain-here' ), |
|
| 24 | - 'subtitle' => wp_kses_post( __( 'Click <code>On</code> to see the text field appear.', 'your-textdomain-here' ) ), |
|
| 25 | - 'default' => false, |
|
| 26 | - ), |
|
| 27 | - array( |
|
| 28 | - 'id' => 'opt-required-basic-text', |
|
| 29 | - 'type' => 'text', |
|
| 30 | - 'title' => esc_html__( 'Basic Text Field', 'your-textdomain-here' ), |
|
| 31 | - 'subtitle' => wp_kses_post( __( 'This text field is only show when the above switch is set to <code>On</code>, using the <code>required</code> argument.', 'your-textdomain-here' ) ), |
|
| 32 | - 'required' => array( 'opt-required-basic', '=', true ), |
|
| 33 | - ), |
|
| 34 | - array( |
|
| 35 | - 'id' => 'opt-required-divide-1', |
|
| 36 | - 'type' => 'divide', |
|
| 37 | - ), |
|
| 38 | - array( |
|
| 39 | - 'id' => 'opt-required-nested', |
|
| 40 | - 'type' => 'switch', |
|
| 41 | - 'title' => esc_html__( 'Nested Required Example', 'your-textdomain-here' ), |
|
| 42 | - 'subtitle' => wp_kses_post( __( 'Click <code>On</code> to see another set of options appear.', 'your-textdomain-here' ) ), |
|
| 43 | - 'default' => false, |
|
| 44 | - ), |
|
| 45 | - array( |
|
| 46 | - 'id' => 'opt-required-nested-buttonset', |
|
| 47 | - 'type' => 'button_set', |
|
| 48 | - 'title' => esc_html__( 'Multiple Nested Required Examples', 'your-textdomain-here' ), |
|
| 49 | - 'subtitle' => wp_kses_post( __( 'Click any button to show different fields based on their <code>required</code> statements.', 'your-textdomain-here' ) ), |
|
| 50 | - 'options' => array( |
|
| 51 | - 'button-text' => esc_html__( 'Show Text Field', 'your-textdomain-here' ), |
|
| 52 | - 'button-textarea' => esc_html__( 'Show Textarea Field', 'your-textdomain-here' ), |
|
| 53 | - 'button-editor' => esc_html__( 'Show WP Editor', 'your-textdomain-here' ), |
|
| 54 | - 'button-ace' => esc_html__( 'Show ACE Editor', 'your-textdomain-here' ), |
|
| 55 | - ), |
|
| 56 | - 'required' => array( 'opt-required-nested', '=', true ), |
|
| 57 | - 'default' => 'button-text', |
|
| 58 | - ), |
|
| 59 | - array( |
|
| 60 | - 'id' => 'opt-required-nested-text', |
|
| 61 | - 'type' => 'text', |
|
| 62 | - 'title' => esc_html__( 'Nested Text Field', 'your-textdomain-here' ), |
|
| 63 | - 'required' => array( 'opt-required-nested-buttonset', '=', 'button-text' ), |
|
| 64 | - ), |
|
| 65 | - array( |
|
| 66 | - 'id' => 'opt-required-nested-textarea', |
|
| 67 | - 'type' => 'textarea', |
|
| 68 | - 'title' => esc_html__( 'Nested Textarea Field', 'your-textdomain-here' ), |
|
| 69 | - 'required' => array( 'opt-required-nested-buttonset', '=', 'button-textarea' ), |
|
| 70 | - ), |
|
| 71 | - array( |
|
| 72 | - 'id' => 'opt-required-nested-editor', |
|
| 73 | - 'type' => 'editor', |
|
| 74 | - 'title' => esc_html__( 'Nested Editor Field', 'your-textdomain-here' ), |
|
| 75 | - 'required' => array( 'opt-required-nested-buttonset', '=', 'button-editor' ), |
|
| 76 | - ), |
|
| 77 | - array( |
|
| 78 | - 'id' => 'opt-required-nested-ace', |
|
| 79 | - 'type' => 'ace_editor', |
|
| 80 | - 'title' => esc_html__( 'Nested ACE Editor Field', 'your-textdomain-here' ), |
|
| 81 | - 'required' => array( 'opt-required-nested-buttonset', '=', 'button-ace' ), |
|
| 82 | - ), |
|
| 83 | - array( |
|
| 84 | - 'id' => 'opt-required-divide-2', |
|
| 85 | - 'type' => 'divide', |
|
| 86 | - ), |
|
| 87 | - array( |
|
| 88 | - 'id' => 'opt-required-select', |
|
| 89 | - 'type' => 'select', |
|
| 90 | - 'title' => esc_html__( 'Select Required Example', 'your-textdomain-here' ), |
|
| 91 | - 'subtitle' => esc_html__( 'Select a different option to display its value. Required may be used to display multiple & reusable fields', 'your-textdomain-here' ), |
|
| 92 | - 'options' => array( |
|
| 93 | - 'no-sidebar' => esc_html__( 'No Sidebars', 'your-textdomain-here' ), |
|
| 94 | - 'left-sidebar' => esc_html__( 'Left Sidebar', 'your-textdomain-here' ), |
|
| 95 | - 'right-sidebar' => esc_html__( 'Right Sidebar', 'your-textdomain-here' ), |
|
| 96 | - 'both-sidebars' => esc_html__( 'Both Sidebars', 'your-textdomain-here' ), |
|
| 97 | - ), |
|
| 98 | - 'default' => 'no-sidebar', |
|
| 99 | - 'select2' => array( 'allowClear' => false ), |
|
| 100 | - ), |
|
| 101 | - array( |
|
| 102 | - 'id' => 'opt-required-select-left-sidebar', |
|
| 103 | - 'type' => 'select', |
|
| 104 | - 'title' => esc_html__( 'Select Left Sidebar', 'your-textdomain-here' ), |
|
| 105 | - 'data' => 'sidebars', |
|
| 106 | - 'default' => '', |
|
| 107 | - 'required' => array( 'opt-required-select', '=', array( 'left-sidebar', 'both-sidebars' ) ), |
|
| 108 | - ), |
|
| 109 | - array( |
|
| 110 | - 'id' => 'opt-required-select-right-sidebar', |
|
| 111 | - 'type' => 'select', |
|
| 112 | - 'title' => esc_html__( 'Select Right Sidebar', 'your-textdomain-here' ), |
|
| 113 | - 'data' => 'sidebars', |
|
| 114 | - 'default' => '', |
|
| 115 | - 'required' => array( 'opt-required-select', '=', array( 'right-sidebar', 'both-sidebars' ) ), |
|
| 116 | - ), |
|
| 117 | - ), |
|
| 118 | - ) |
|
| 13 | + $opt_name, |
|
| 14 | + array( |
|
| 15 | + 'title' => esc_html__( 'Field Required / Linking', 'your-textdomain-here' ), |
|
| 16 | + 'id' => 'required', |
|
| 17 | + 'desc' => esc_html__( 'For full documentation on validation, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/configuration/fields/required.html" target="_blank">https://devs.redux.io/configuration/fields/required.html</a>', |
|
| 18 | + 'subsection' => true, |
|
| 19 | + 'fields' => array( |
|
| 20 | + array( |
|
| 21 | + 'id' => 'opt-required-basic', |
|
| 22 | + 'type' => 'switch', |
|
| 23 | + 'title' => esc_html__( 'Basic Required Example', 'your-textdomain-here' ), |
|
| 24 | + 'subtitle' => wp_kses_post( __( 'Click <code>On</code> to see the text field appear.', 'your-textdomain-here' ) ), |
|
| 25 | + 'default' => false, |
|
| 26 | + ), |
|
| 27 | + array( |
|
| 28 | + 'id' => 'opt-required-basic-text', |
|
| 29 | + 'type' => 'text', |
|
| 30 | + 'title' => esc_html__( 'Basic Text Field', 'your-textdomain-here' ), |
|
| 31 | + 'subtitle' => wp_kses_post( __( 'This text field is only show when the above switch is set to <code>On</code>, using the <code>required</code> argument.', 'your-textdomain-here' ) ), |
|
| 32 | + 'required' => array( 'opt-required-basic', '=', true ), |
|
| 33 | + ), |
|
| 34 | + array( |
|
| 35 | + 'id' => 'opt-required-divide-1', |
|
| 36 | + 'type' => 'divide', |
|
| 37 | + ), |
|
| 38 | + array( |
|
| 39 | + 'id' => 'opt-required-nested', |
|
| 40 | + 'type' => 'switch', |
|
| 41 | + 'title' => esc_html__( 'Nested Required Example', 'your-textdomain-here' ), |
|
| 42 | + 'subtitle' => wp_kses_post( __( 'Click <code>On</code> to see another set of options appear.', 'your-textdomain-here' ) ), |
|
| 43 | + 'default' => false, |
|
| 44 | + ), |
|
| 45 | + array( |
|
| 46 | + 'id' => 'opt-required-nested-buttonset', |
|
| 47 | + 'type' => 'button_set', |
|
| 48 | + 'title' => esc_html__( 'Multiple Nested Required Examples', 'your-textdomain-here' ), |
|
| 49 | + 'subtitle' => wp_kses_post( __( 'Click any button to show different fields based on their <code>required</code> statements.', 'your-textdomain-here' ) ), |
|
| 50 | + 'options' => array( |
|
| 51 | + 'button-text' => esc_html__( 'Show Text Field', 'your-textdomain-here' ), |
|
| 52 | + 'button-textarea' => esc_html__( 'Show Textarea Field', 'your-textdomain-here' ), |
|
| 53 | + 'button-editor' => esc_html__( 'Show WP Editor', 'your-textdomain-here' ), |
|
| 54 | + 'button-ace' => esc_html__( 'Show ACE Editor', 'your-textdomain-here' ), |
|
| 55 | + ), |
|
| 56 | + 'required' => array( 'opt-required-nested', '=', true ), |
|
| 57 | + 'default' => 'button-text', |
|
| 58 | + ), |
|
| 59 | + array( |
|
| 60 | + 'id' => 'opt-required-nested-text', |
|
| 61 | + 'type' => 'text', |
|
| 62 | + 'title' => esc_html__( 'Nested Text Field', 'your-textdomain-here' ), |
|
| 63 | + 'required' => array( 'opt-required-nested-buttonset', '=', 'button-text' ), |
|
| 64 | + ), |
|
| 65 | + array( |
|
| 66 | + 'id' => 'opt-required-nested-textarea', |
|
| 67 | + 'type' => 'textarea', |
|
| 68 | + 'title' => esc_html__( 'Nested Textarea Field', 'your-textdomain-here' ), |
|
| 69 | + 'required' => array( 'opt-required-nested-buttonset', '=', 'button-textarea' ), |
|
| 70 | + ), |
|
| 71 | + array( |
|
| 72 | + 'id' => 'opt-required-nested-editor', |
|
| 73 | + 'type' => 'editor', |
|
| 74 | + 'title' => esc_html__( 'Nested Editor Field', 'your-textdomain-here' ), |
|
| 75 | + 'required' => array( 'opt-required-nested-buttonset', '=', 'button-editor' ), |
|
| 76 | + ), |
|
| 77 | + array( |
|
| 78 | + 'id' => 'opt-required-nested-ace', |
|
| 79 | + 'type' => 'ace_editor', |
|
| 80 | + 'title' => esc_html__( 'Nested ACE Editor Field', 'your-textdomain-here' ), |
|
| 81 | + 'required' => array( 'opt-required-nested-buttonset', '=', 'button-ace' ), |
|
| 82 | + ), |
|
| 83 | + array( |
|
| 84 | + 'id' => 'opt-required-divide-2', |
|
| 85 | + 'type' => 'divide', |
|
| 86 | + ), |
|
| 87 | + array( |
|
| 88 | + 'id' => 'opt-required-select', |
|
| 89 | + 'type' => 'select', |
|
| 90 | + 'title' => esc_html__( 'Select Required Example', 'your-textdomain-here' ), |
|
| 91 | + 'subtitle' => esc_html__( 'Select a different option to display its value. Required may be used to display multiple & reusable fields', 'your-textdomain-here' ), |
|
| 92 | + 'options' => array( |
|
| 93 | + 'no-sidebar' => esc_html__( 'No Sidebars', 'your-textdomain-here' ), |
|
| 94 | + 'left-sidebar' => esc_html__( 'Left Sidebar', 'your-textdomain-here' ), |
|
| 95 | + 'right-sidebar' => esc_html__( 'Right Sidebar', 'your-textdomain-here' ), |
|
| 96 | + 'both-sidebars' => esc_html__( 'Both Sidebars', 'your-textdomain-here' ), |
|
| 97 | + ), |
|
| 98 | + 'default' => 'no-sidebar', |
|
| 99 | + 'select2' => array( 'allowClear' => false ), |
|
| 100 | + ), |
|
| 101 | + array( |
|
| 102 | + 'id' => 'opt-required-select-left-sidebar', |
|
| 103 | + 'type' => 'select', |
|
| 104 | + 'title' => esc_html__( 'Select Left Sidebar', 'your-textdomain-here' ), |
|
| 105 | + 'data' => 'sidebars', |
|
| 106 | + 'default' => '', |
|
| 107 | + 'required' => array( 'opt-required-select', '=', array( 'left-sidebar', 'both-sidebars' ) ), |
|
| 108 | + ), |
|
| 109 | + array( |
|
| 110 | + 'id' => 'opt-required-select-right-sidebar', |
|
| 111 | + 'type' => 'select', |
|
| 112 | + 'title' => esc_html__( 'Select Right Sidebar', 'your-textdomain-here' ), |
|
| 113 | + 'data' => 'sidebars', |
|
| 114 | + 'default' => '', |
|
| 115 | + 'required' => array( 'opt-required-select', '=', array( 'right-sidebar', 'both-sidebars' ) ), |
|
| 116 | + ), |
|
| 117 | + ), |
|
| 118 | + ) |
|
| 119 | 119 | ); |
| 120 | 120 | // phpcs:enable |
@@ -10,30 +10,30 @@ |
||
| 10 | 10 | defined( 'ABSPATH' ) || exit; |
| 11 | 11 | |
| 12 | 12 | Redux::set_section( |
| 13 | - $opt_name, |
|
| 14 | - array( |
|
| 15 | - 'title' => esc_html__( 'WPML Integration', 'your-textdomain-here' ), |
|
| 16 | - 'desc' => esc_html__( 'These fields can be fully translated by WPML (WordPress Multi-Language). This serves as an example for you to implement. For extra details look at our WPML Implementation documentation: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/guides/advanced/wpml-integration.html" target="_blank" >https://devs.redux.io/guides/advanced/wpml-integration.html</a>', |
|
| 17 | - 'subsection' => true, |
|
| 18 | - 'fields' => array( |
|
| 19 | - array( |
|
| 20 | - 'id' => 'wpml-text', |
|
| 21 | - 'type' => 'textarea', |
|
| 22 | - 'title' => esc_html__( 'WPML Text', 'your-textdomain-here' ), |
|
| 23 | - 'desc' => esc_html__( 'This string can be translated via WPML.', 'your-textdomain-here' ), |
|
| 24 | - ), |
|
| 25 | - array( |
|
| 26 | - 'id' => 'wpml-multicheck', |
|
| 27 | - 'type' => 'checkbox', |
|
| 28 | - 'title' => esc_html__( 'WPML Multi Checkbox', 'your-textdomain-here' ), |
|
| 29 | - 'desc' => esc_html__( 'You can literally translate the values via key.', 'your-textdomain-here' ), |
|
| 30 | - 'options' => array( |
|
| 31 | - '1' => esc_html__( 'Option 1', 'your-textdomain-here' ), |
|
| 32 | - '2' => esc_html__( 'Option 2', 'your-textdomain-here' ), |
|
| 33 | - '3' => esc_html__( 'Option 3', 'your-textdomain-here' ), |
|
| 34 | - ), |
|
| 35 | - ), |
|
| 36 | - ), |
|
| 37 | - ) |
|
| 13 | + $opt_name, |
|
| 14 | + array( |
|
| 15 | + 'title' => esc_html__( 'WPML Integration', 'your-textdomain-here' ), |
|
| 16 | + 'desc' => esc_html__( 'These fields can be fully translated by WPML (WordPress Multi-Language). This serves as an example for you to implement. For extra details look at our WPML Implementation documentation: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/guides/advanced/wpml-integration.html" target="_blank" >https://devs.redux.io/guides/advanced/wpml-integration.html</a>', |
|
| 17 | + 'subsection' => true, |
|
| 18 | + 'fields' => array( |
|
| 19 | + array( |
|
| 20 | + 'id' => 'wpml-text', |
|
| 21 | + 'type' => 'textarea', |
|
| 22 | + 'title' => esc_html__( 'WPML Text', 'your-textdomain-here' ), |
|
| 23 | + 'desc' => esc_html__( 'This string can be translated via WPML.', 'your-textdomain-here' ), |
|
| 24 | + ), |
|
| 25 | + array( |
|
| 26 | + 'id' => 'wpml-multicheck', |
|
| 27 | + 'type' => 'checkbox', |
|
| 28 | + 'title' => esc_html__( 'WPML Multi Checkbox', 'your-textdomain-here' ), |
|
| 29 | + 'desc' => esc_html__( 'You can literally translate the values via key.', 'your-textdomain-here' ), |
|
| 30 | + 'options' => array( |
|
| 31 | + '1' => esc_html__( 'Option 1', 'your-textdomain-here' ), |
|
| 32 | + '2' => esc_html__( 'Option 2', 'your-textdomain-here' ), |
|
| 33 | + '3' => esc_html__( 'Option 3', 'your-textdomain-here' ), |
|
| 34 | + ), |
|
| 35 | + ), |
|
| 36 | + ), |
|
| 37 | + ) |
|
| 38 | 38 | ); |
| 39 | 39 | // phpcs:enable |
@@ -10,42 +10,42 @@ |
||
| 10 | 10 | defined( 'ABSPATH' ) || exit; |
| 11 | 11 | |
| 12 | 12 | Redux::set_section( |
| 13 | - $opt_name, |
|
| 14 | - array( |
|
| 15 | - 'title' => esc_html__( 'Field Sanitizing', 'your-textdomain-here' ), |
|
| 16 | - 'id' => 'sanitizing', |
|
| 17 | - // phpcs:ignore |
|
| 18 | - // 'desc' => esc_html__( 'For full documentation on sanitizing, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/configuration/fields/sanitizing/" target="_blank">https://devs.redux.io/configuration/fields/sanitizing/</a>', |
|
| 19 | - 'subsection' => true, |
|
| 20 | - 'fields' => array( |
|
| 21 | - array( |
|
| 22 | - 'id' => 'opt-text-uppercase', |
|
| 23 | - 'type' => 'text', |
|
| 24 | - 'title' => esc_html__( 'Text Option - Force Uppercase', 'your-textdomain-here' ), |
|
| 25 | - 'subtitle' => esc_html__( 'Uses the strtoupper function to force all uppercase characters.', 'your-textdomain-here' ), |
|
| 26 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 27 | - 'sanitize' => array( 'strtoupper' ), |
|
| 28 | - 'default' => 'Force Uppercase', |
|
| 29 | - ), |
|
| 30 | - array( |
|
| 31 | - 'id' => 'opt-text-sanitize-title', |
|
| 32 | - 'type' => 'text', |
|
| 33 | - 'title' => esc_html__( 'Text Option - Sanitize Title', 'your-textdomain-here' ), |
|
| 34 | - 'subtitle' => esc_html__( 'Uses the WordPress sanitize_title function to format text.', 'your-textdomain-here' ), |
|
| 35 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 36 | - 'sanitize' => array( 'sanitize_title' ), |
|
| 37 | - 'default' => 'Sanitize This Title', |
|
| 38 | - ), |
|
| 39 | - array( |
|
| 40 | - 'id' => 'opt-text-custom-sanitize', |
|
| 41 | - 'type' => 'text', |
|
| 42 | - 'title' => esc_html__( 'Text Option - Custom Sanitize', 'your-textdomain-here' ), |
|
| 43 | - 'subtitle' => esc_html__( 'Uses the custom function redux_custom_sanitize to capitalize every other letter.', 'your-textdomain-here' ), |
|
| 44 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 45 | - 'sanitize' => array( 'redux_custom_sanitize' ), |
|
| 46 | - 'default' => 'Sanitize This Text', |
|
| 47 | - ), |
|
| 48 | - ), |
|
| 49 | - ) |
|
| 13 | + $opt_name, |
|
| 14 | + array( |
|
| 15 | + 'title' => esc_html__( 'Field Sanitizing', 'your-textdomain-here' ), |
|
| 16 | + 'id' => 'sanitizing', |
|
| 17 | + // phpcs:ignore |
|
| 18 | + // 'desc' => esc_html__( 'For full documentation on sanitizing, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/configuration/fields/sanitizing/" target="_blank">https://devs.redux.io/configuration/fields/sanitizing/</a>', |
|
| 19 | + 'subsection' => true, |
|
| 20 | + 'fields' => array( |
|
| 21 | + array( |
|
| 22 | + 'id' => 'opt-text-uppercase', |
|
| 23 | + 'type' => 'text', |
|
| 24 | + 'title' => esc_html__( 'Text Option - Force Uppercase', 'your-textdomain-here' ), |
|
| 25 | + 'subtitle' => esc_html__( 'Uses the strtoupper function to force all uppercase characters.', 'your-textdomain-here' ), |
|
| 26 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 27 | + 'sanitize' => array( 'strtoupper' ), |
|
| 28 | + 'default' => 'Force Uppercase', |
|
| 29 | + ), |
|
| 30 | + array( |
|
| 31 | + 'id' => 'opt-text-sanitize-title', |
|
| 32 | + 'type' => 'text', |
|
| 33 | + 'title' => esc_html__( 'Text Option - Sanitize Title', 'your-textdomain-here' ), |
|
| 34 | + 'subtitle' => esc_html__( 'Uses the WordPress sanitize_title function to format text.', 'your-textdomain-here' ), |
|
| 35 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 36 | + 'sanitize' => array( 'sanitize_title' ), |
|
| 37 | + 'default' => 'Sanitize This Title', |
|
| 38 | + ), |
|
| 39 | + array( |
|
| 40 | + 'id' => 'opt-text-custom-sanitize', |
|
| 41 | + 'type' => 'text', |
|
| 42 | + 'title' => esc_html__( 'Text Option - Custom Sanitize', 'your-textdomain-here' ), |
|
| 43 | + 'subtitle' => esc_html__( 'Uses the custom function redux_custom_sanitize to capitalize every other letter.', 'your-textdomain-here' ), |
|
| 44 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 45 | + 'sanitize' => array( 'redux_custom_sanitize' ), |
|
| 46 | + 'default' => 'Sanitize This Text', |
|
| 47 | + ), |
|
| 48 | + ), |
|
| 49 | + ) |
|
| 50 | 50 | ); |
| 51 | 51 | // phpcs:enable |
@@ -10,157 +10,157 @@ |
||
| 10 | 10 | defined( 'ABSPATH' ) || exit; |
| 11 | 11 | |
| 12 | 12 | Redux::set_section( |
| 13 | - $opt_name, |
|
| 14 | - array( |
|
| 15 | - 'title' => esc_html__( 'Field Validation', 'your-textdomain-here' ), |
|
| 16 | - 'id' => 'validation', |
|
| 17 | - 'desc' => esc_html__( 'For full documentation on validation, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/configuration/fields/validate.html" target="_blank">https://devs.redux.io/configuration/fields/validate.html</a>', |
|
| 18 | - 'subsection' => true, |
|
| 19 | - 'fields' => array( |
|
| 20 | - array( |
|
| 21 | - 'id' => 'opt-text-email', |
|
| 22 | - 'type' => 'text', |
|
| 23 | - 'title' => esc_html__( 'Text Option - Email Validated', 'your-textdomain-here' ), |
|
| 24 | - 'subtitle' => esc_html__( 'This is a little space under the Field Title in the Options table, additional info is good in here.', 'your-textdomain-here' ), |
|
| 25 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 26 | - 'validate' => 'email', |
|
| 27 | - 'msg' => 'An error message you could customize via your option array!', |
|
| 28 | - 'default' => '[email protected]', |
|
| 29 | - ), |
|
| 30 | - array( |
|
| 31 | - 'id' => 'opt-text-post-type', |
|
| 32 | - 'type' => 'text', |
|
| 33 | - 'title' => esc_html__( 'Text Option with Data Attributes', 'your-textdomain-here' ), |
|
| 34 | - 'subtitle' => esc_html__( 'You can also pass an options array if you want. Set the default to whatever you like.', 'your-textdomain-here' ), |
|
| 35 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 36 | - 'data' => 'post_type', |
|
| 37 | - ), |
|
| 38 | - array( |
|
| 39 | - 'id' => 'opt-multi-text', |
|
| 40 | - 'type' => 'multi_text', |
|
| 41 | - 'title' => esc_html__( 'Multi Text Option - Color Validated', 'your-textdomain-here' ), |
|
| 42 | - 'validate' => 'color', |
|
| 43 | - 'subtitle' => esc_html__( 'If you enter an invalid color it will be removed. Try using the text "blue" as a color. ;)', 'your-textdomain-here' ), |
|
| 44 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 45 | - ), |
|
| 46 | - array( |
|
| 47 | - 'id' => 'opt-text-url', |
|
| 48 | - 'type' => 'text', |
|
| 49 | - 'title' => esc_html__( 'Text Option - URL Validated', 'your-textdomain-here' ), |
|
| 50 | - 'subtitle' => esc_html__( 'This must be a URL.', 'your-textdomain-here' ), |
|
| 51 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 52 | - 'validate' => 'url', |
|
| 53 | - 'default' => 'https://redux.io', |
|
| 54 | - ), |
|
| 55 | - array( |
|
| 56 | - 'id' => 'opt-text-numeric', |
|
| 57 | - 'type' => 'text', |
|
| 58 | - 'title' => esc_html__( 'Text Option - Numeric Validated', 'your-textdomain-here' ), |
|
| 59 | - 'subtitle' => esc_html__( 'This must be numeric.', 'your-textdomain-here' ), |
|
| 60 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 61 | - 'validate' => array( 'numeric', 'not_empty' ), |
|
| 62 | - 'default' => '0', |
|
| 63 | - ), |
|
| 64 | - array( |
|
| 65 | - 'id' => 'opt-text-comma-numeric', |
|
| 66 | - 'type' => 'text', |
|
| 67 | - 'title' => esc_html__( 'Text Option - Comma Numeric Validated', 'your-textdomain-here' ), |
|
| 68 | - 'subtitle' => esc_html__( 'This must be a comma separated string of numerical values.', 'your-textdomain-here' ), |
|
| 69 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 70 | - 'validate' => 'comma_numeric', |
|
| 71 | - 'default' => '0', |
|
| 72 | - ), |
|
| 73 | - array( |
|
| 74 | - 'id' => 'opt-text-no-special-chars', |
|
| 75 | - 'type' => 'text', |
|
| 76 | - 'title' => __( 'Text Option - No Special Chars Validated', 'your-textdomain-here' ), |
|
| 77 | - 'subtitle' => __( 'This must be a alpha numeric only.', 'your-textdomain-here' ), |
|
| 78 | - 'desc' => __( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 79 | - 'validate' => 'no_special_chars', |
|
| 80 | - 'default' => '0', |
|
| 81 | - ), |
|
| 82 | - array( |
|
| 83 | - 'id' => 'opt-text-str_replace', |
|
| 84 | - 'type' => 'text', |
|
| 85 | - 'title' => esc_html__( 'Text Option - Str Replace Validated', 'your-textdomain-here' ), |
|
| 86 | - 'subtitle' => esc_html__( 'You decide.', 'your-textdomain-here' ), |
|
| 87 | - 'desc' => esc_html__( 'This field\'s default value was changed by a filter hook!', 'your-textdomain-here' ), |
|
| 88 | - 'validate' => 'str_replace', |
|
| 89 | - 'str' => array( |
|
| 90 | - 'search' => ' ', |
|
| 91 | - 'replacement' => '-thisisaspace-', |
|
| 92 | - ), |
|
| 93 | - 'default' => 'This is the default.', |
|
| 94 | - ), |
|
| 95 | - array( |
|
| 96 | - 'id' => 'opt-text-preg_replace', |
|
| 97 | - 'type' => 'text', |
|
| 98 | - 'title' => esc_html__( 'Text Option - Preg Replace Validated', 'your-textdomain-here' ), |
|
| 99 | - 'subtitle' => esc_html__( 'You decide.', 'your-textdomain-here' ), |
|
| 100 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 101 | - 'validate' => 'preg_replace', |
|
| 102 | - 'preg' => array( |
|
| 103 | - 'pattern' => '/.*?\\d.*?\\d(\\d)/is', |
|
| 104 | - 'replacement' => 'no numbers', |
|
| 105 | - ), |
|
| 106 | - 'default' => '0', |
|
| 107 | - ), |
|
| 108 | - array( |
|
| 109 | - 'id' => 'opt-text-custom_validate', |
|
| 110 | - 'type' => 'text', |
|
| 111 | - 'title' => esc_html__( 'Text Option - Custom Callback Validated', 'your-textdomain-here' ), |
|
| 112 | - 'subtitle' => esc_html__( 'You decide.', 'your-textdomain-here' ), |
|
| 113 | - 'desc' => wp_kses( __( 'Enter <code>1</code> and click <strong>Save Changes</strong> for an error message, or enter <code>2</code> and click <strong>Save Changes</strong> for a warning message.', 'your-textdomain-here' ), $kses_exceptions ), |
|
| 114 | - 'validate_callback' => 'redux_validate_callback_function', |
|
| 115 | - 'default' => '0', |
|
| 116 | - ), |
|
| 117 | - array( |
|
| 118 | - 'id' => 'opt-textarea-no-html', |
|
| 119 | - 'type' => 'textarea', |
|
| 120 | - 'title' => esc_html__( 'Textarea Option - No HTML Validated', 'your-textdomain-here' ), |
|
| 121 | - 'subtitle' => esc_html__( 'All HTML will be stripped', 'your-textdomain-here' ), |
|
| 122 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 123 | - 'validate' => 'no_html', |
|
| 124 | - 'default' => 'No HTML is allowed in here.', |
|
| 125 | - ), |
|
| 126 | - array( |
|
| 127 | - 'id' => 'opt-textarea-html', |
|
| 128 | - 'type' => 'textarea', |
|
| 129 | - 'title' => esc_html__( 'Textarea Option - HTML Validated', 'your-textdomain-here' ), |
|
| 130 | - 'subtitle' => esc_html__( 'HTML Allowed (wp_kses)', 'your-textdomain-here' ), |
|
| 131 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 132 | - 'validate' => 'html', // See http://codex.wordpress.org/Function_Reference/wp_kses_post. |
|
| 133 | - 'default' => 'HTML is allowed in here.', |
|
| 134 | - ), |
|
| 135 | - array( |
|
| 136 | - 'id' => 'opt-textarea-some-html', |
|
| 137 | - 'type' => 'textarea', |
|
| 138 | - 'title' => esc_html__( 'Textarea Option - HTML Validated Custom', 'your-textdomain-here' ), |
|
| 139 | - 'subtitle' => esc_html__( 'Custom HTML Allowed (wp_kses)', 'your-textdomain-here' ), |
|
| 140 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 141 | - 'validate' => 'html_custom', |
|
| 142 | - 'default' => '<p>Some HTML is allowed in here.</p>', |
|
| 13 | + $opt_name, |
|
| 14 | + array( |
|
| 15 | + 'title' => esc_html__( 'Field Validation', 'your-textdomain-here' ), |
|
| 16 | + 'id' => 'validation', |
|
| 17 | + 'desc' => esc_html__( 'For full documentation on validation, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/configuration/fields/validate.html" target="_blank">https://devs.redux.io/configuration/fields/validate.html</a>', |
|
| 18 | + 'subsection' => true, |
|
| 19 | + 'fields' => array( |
|
| 20 | + array( |
|
| 21 | + 'id' => 'opt-text-email', |
|
| 22 | + 'type' => 'text', |
|
| 23 | + 'title' => esc_html__( 'Text Option - Email Validated', 'your-textdomain-here' ), |
|
| 24 | + 'subtitle' => esc_html__( 'This is a little space under the Field Title in the Options table, additional info is good in here.', 'your-textdomain-here' ), |
|
| 25 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 26 | + 'validate' => 'email', |
|
| 27 | + 'msg' => 'An error message you could customize via your option array!', |
|
| 28 | + 'default' => '[email protected]', |
|
| 29 | + ), |
|
| 30 | + array( |
|
| 31 | + 'id' => 'opt-text-post-type', |
|
| 32 | + 'type' => 'text', |
|
| 33 | + 'title' => esc_html__( 'Text Option with Data Attributes', 'your-textdomain-here' ), |
|
| 34 | + 'subtitle' => esc_html__( 'You can also pass an options array if you want. Set the default to whatever you like.', 'your-textdomain-here' ), |
|
| 35 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 36 | + 'data' => 'post_type', |
|
| 37 | + ), |
|
| 38 | + array( |
|
| 39 | + 'id' => 'opt-multi-text', |
|
| 40 | + 'type' => 'multi_text', |
|
| 41 | + 'title' => esc_html__( 'Multi Text Option - Color Validated', 'your-textdomain-here' ), |
|
| 42 | + 'validate' => 'color', |
|
| 43 | + 'subtitle' => esc_html__( 'If you enter an invalid color it will be removed. Try using the text "blue" as a color. ;)', 'your-textdomain-here' ), |
|
| 44 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 45 | + ), |
|
| 46 | + array( |
|
| 47 | + 'id' => 'opt-text-url', |
|
| 48 | + 'type' => 'text', |
|
| 49 | + 'title' => esc_html__( 'Text Option - URL Validated', 'your-textdomain-here' ), |
|
| 50 | + 'subtitle' => esc_html__( 'This must be a URL.', 'your-textdomain-here' ), |
|
| 51 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 52 | + 'validate' => 'url', |
|
| 53 | + 'default' => 'https://redux.io', |
|
| 54 | + ), |
|
| 55 | + array( |
|
| 56 | + 'id' => 'opt-text-numeric', |
|
| 57 | + 'type' => 'text', |
|
| 58 | + 'title' => esc_html__( 'Text Option - Numeric Validated', 'your-textdomain-here' ), |
|
| 59 | + 'subtitle' => esc_html__( 'This must be numeric.', 'your-textdomain-here' ), |
|
| 60 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 61 | + 'validate' => array( 'numeric', 'not_empty' ), |
|
| 62 | + 'default' => '0', |
|
| 63 | + ), |
|
| 64 | + array( |
|
| 65 | + 'id' => 'opt-text-comma-numeric', |
|
| 66 | + 'type' => 'text', |
|
| 67 | + 'title' => esc_html__( 'Text Option - Comma Numeric Validated', 'your-textdomain-here' ), |
|
| 68 | + 'subtitle' => esc_html__( 'This must be a comma separated string of numerical values.', 'your-textdomain-here' ), |
|
| 69 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 70 | + 'validate' => 'comma_numeric', |
|
| 71 | + 'default' => '0', |
|
| 72 | + ), |
|
| 73 | + array( |
|
| 74 | + 'id' => 'opt-text-no-special-chars', |
|
| 75 | + 'type' => 'text', |
|
| 76 | + 'title' => __( 'Text Option - No Special Chars Validated', 'your-textdomain-here' ), |
|
| 77 | + 'subtitle' => __( 'This must be a alpha numeric only.', 'your-textdomain-here' ), |
|
| 78 | + 'desc' => __( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 79 | + 'validate' => 'no_special_chars', |
|
| 80 | + 'default' => '0', |
|
| 81 | + ), |
|
| 82 | + array( |
|
| 83 | + 'id' => 'opt-text-str_replace', |
|
| 84 | + 'type' => 'text', |
|
| 85 | + 'title' => esc_html__( 'Text Option - Str Replace Validated', 'your-textdomain-here' ), |
|
| 86 | + 'subtitle' => esc_html__( 'You decide.', 'your-textdomain-here' ), |
|
| 87 | + 'desc' => esc_html__( 'This field\'s default value was changed by a filter hook!', 'your-textdomain-here' ), |
|
| 88 | + 'validate' => 'str_replace', |
|
| 89 | + 'str' => array( |
|
| 90 | + 'search' => ' ', |
|
| 91 | + 'replacement' => '-thisisaspace-', |
|
| 92 | + ), |
|
| 93 | + 'default' => 'This is the default.', |
|
| 94 | + ), |
|
| 95 | + array( |
|
| 96 | + 'id' => 'opt-text-preg_replace', |
|
| 97 | + 'type' => 'text', |
|
| 98 | + 'title' => esc_html__( 'Text Option - Preg Replace Validated', 'your-textdomain-here' ), |
|
| 99 | + 'subtitle' => esc_html__( 'You decide.', 'your-textdomain-here' ), |
|
| 100 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 101 | + 'validate' => 'preg_replace', |
|
| 102 | + 'preg' => array( |
|
| 103 | + 'pattern' => '/.*?\\d.*?\\d(\\d)/is', |
|
| 104 | + 'replacement' => 'no numbers', |
|
| 105 | + ), |
|
| 106 | + 'default' => '0', |
|
| 107 | + ), |
|
| 108 | + array( |
|
| 109 | + 'id' => 'opt-text-custom_validate', |
|
| 110 | + 'type' => 'text', |
|
| 111 | + 'title' => esc_html__( 'Text Option - Custom Callback Validated', 'your-textdomain-here' ), |
|
| 112 | + 'subtitle' => esc_html__( 'You decide.', 'your-textdomain-here' ), |
|
| 113 | + 'desc' => wp_kses( __( 'Enter <code>1</code> and click <strong>Save Changes</strong> for an error message, or enter <code>2</code> and click <strong>Save Changes</strong> for a warning message.', 'your-textdomain-here' ), $kses_exceptions ), |
|
| 114 | + 'validate_callback' => 'redux_validate_callback_function', |
|
| 115 | + 'default' => '0', |
|
| 116 | + ), |
|
| 117 | + array( |
|
| 118 | + 'id' => 'opt-textarea-no-html', |
|
| 119 | + 'type' => 'textarea', |
|
| 120 | + 'title' => esc_html__( 'Textarea Option - No HTML Validated', 'your-textdomain-here' ), |
|
| 121 | + 'subtitle' => esc_html__( 'All HTML will be stripped', 'your-textdomain-here' ), |
|
| 122 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 123 | + 'validate' => 'no_html', |
|
| 124 | + 'default' => 'No HTML is allowed in here.', |
|
| 125 | + ), |
|
| 126 | + array( |
|
| 127 | + 'id' => 'opt-textarea-html', |
|
| 128 | + 'type' => 'textarea', |
|
| 129 | + 'title' => esc_html__( 'Textarea Option - HTML Validated', 'your-textdomain-here' ), |
|
| 130 | + 'subtitle' => esc_html__( 'HTML Allowed (wp_kses)', 'your-textdomain-here' ), |
|
| 131 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 132 | + 'validate' => 'html', // See http://codex.wordpress.org/Function_Reference/wp_kses_post. |
|
| 133 | + 'default' => 'HTML is allowed in here.', |
|
| 134 | + ), |
|
| 135 | + array( |
|
| 136 | + 'id' => 'opt-textarea-some-html', |
|
| 137 | + 'type' => 'textarea', |
|
| 138 | + 'title' => esc_html__( 'Textarea Option - HTML Validated Custom', 'your-textdomain-here' ), |
|
| 139 | + 'subtitle' => esc_html__( 'Custom HTML Allowed (wp_kses)', 'your-textdomain-here' ), |
|
| 140 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 141 | + 'validate' => 'html_custom', |
|
| 142 | + 'default' => '<p>Some HTML is allowed in here.</p>', |
|
| 143 | 143 | |
| 144 | - // See http://codex.wordpress.org/Function_Reference/wp_kses. |
|
| 145 | - 'allowed_html' => array( |
|
| 146 | - 'a' => array( |
|
| 147 | - 'href' => array(), |
|
| 148 | - 'title' => array(), |
|
| 149 | - ), |
|
| 150 | - 'br' => array(), |
|
| 151 | - 'em' => array(), |
|
| 152 | - 'strong' => array(), |
|
| 153 | - ), |
|
| 154 | - ), |
|
| 155 | - array( |
|
| 156 | - 'id' => 'opt-textarea-js', |
|
| 157 | - 'type' => 'textarea', |
|
| 158 | - 'title' => esc_html__( 'Textarea Option - JS Validated', 'your-textdomain-here' ), |
|
| 159 | - 'subtitle' => esc_html__( 'JS will be escaped', 'your-textdomain-here' ), |
|
| 160 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 161 | - 'validate' => 'js', |
|
| 162 | - ), |
|
| 163 | - ), |
|
| 164 | - ) |
|
| 144 | + // See http://codex.wordpress.org/Function_Reference/wp_kses. |
|
| 145 | + 'allowed_html' => array( |
|
| 146 | + 'a' => array( |
|
| 147 | + 'href' => array(), |
|
| 148 | + 'title' => array(), |
|
| 149 | + ), |
|
| 150 | + 'br' => array(), |
|
| 151 | + 'em' => array(), |
|
| 152 | + 'strong' => array(), |
|
| 153 | + ), |
|
| 154 | + ), |
|
| 155 | + array( |
|
| 156 | + 'id' => 'opt-textarea-js', |
|
| 157 | + 'type' => 'textarea', |
|
| 158 | + 'title' => esc_html__( 'Textarea Option - JS Validated', 'your-textdomain-here' ), |
|
| 159 | + 'subtitle' => esc_html__( 'JS will be escaped', 'your-textdomain-here' ), |
|
| 160 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 161 | + 'validate' => 'js', |
|
| 162 | + ), |
|
| 163 | + ), |
|
| 164 | + ) |
|
| 165 | 165 | ); |
| 166 | 166 | // phpcs:enable |
@@ -10,36 +10,36 @@ |
||
| 10 | 10 | defined( 'ABSPATH' ) || exit; |
| 11 | 11 | |
| 12 | 12 | Redux::set_section( |
| 13 | - $opt_name, |
|
| 14 | - array( |
|
| 15 | - 'title' => esc_html__( 'Callback', 'your-textdomain-here' ), |
|
| 16 | - 'id' => 'additional-callback', |
|
| 17 | - 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/configuration/fields/data.html#using-a-custom-callback" target="_blank">https://devs.redux.io/configuration/fields/data.html#using-a-custom-callback</a>', |
|
| 18 | - 'subsection' => true, |
|
| 19 | - 'fields' => array( |
|
| 20 | - array( |
|
| 21 | - 'id' => 'opt-custom-callback', |
|
| 22 | - 'type' => 'callback', |
|
| 23 | - 'title' => esc_html__( 'Custom Field Callback', 'your-textdomain-here' ), |
|
| 24 | - 'subtitle' => esc_html__( 'This is a completely unique field type', 'your-textdomain-here' ), |
|
| 25 | - 'desc' => esc_html__( 'This is created with a callback function, so anything goes in this field. Make sure to define the function though.', 'your-textdomain-here' ), |
|
| 26 | - 'callback' => 'redux_my_custom_field', |
|
| 27 | - ), |
|
| 28 | - ), |
|
| 29 | - ) |
|
| 13 | + $opt_name, |
|
| 14 | + array( |
|
| 15 | + 'title' => esc_html__( 'Callback', 'your-textdomain-here' ), |
|
| 16 | + 'id' => 'additional-callback', |
|
| 17 | + 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/configuration/fields/data.html#using-a-custom-callback" target="_blank">https://devs.redux.io/configuration/fields/data.html#using-a-custom-callback</a>', |
|
| 18 | + 'subsection' => true, |
|
| 19 | + 'fields' => array( |
|
| 20 | + array( |
|
| 21 | + 'id' => 'opt-custom-callback', |
|
| 22 | + 'type' => 'callback', |
|
| 23 | + 'title' => esc_html__( 'Custom Field Callback', 'your-textdomain-here' ), |
|
| 24 | + 'subtitle' => esc_html__( 'This is a completely unique field type', 'your-textdomain-here' ), |
|
| 25 | + 'desc' => esc_html__( 'This is created with a callback function, so anything goes in this field. Make sure to define the function though.', 'your-textdomain-here' ), |
|
| 26 | + 'callback' => 'redux_my_custom_field', |
|
| 27 | + ), |
|
| 28 | + ), |
|
| 29 | + ) |
|
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | 32 | if ( ! function_exists( 'redux_my_custom_field' ) ) { |
| 33 | - /** |
|
| 34 | - * Custom function for the callback referenced above. |
|
| 35 | - * |
|
| 36 | - * @param array $field Field array. |
|
| 37 | - * @param mixed $value Set value. |
|
| 38 | - */ |
|
| 39 | - function redux_my_custom_field( array $field, $value ) { |
|
| 40 | - print_r( $field ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions |
|
| 41 | - echo '<br/>'; |
|
| 42 | - print_r( $value ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions |
|
| 43 | - } |
|
| 33 | + /** |
|
| 34 | + * Custom function for the callback referenced above. |
|
| 35 | + * |
|
| 36 | + * @param array $field Field array. |
|
| 37 | + * @param mixed $value Set value. |
|
| 38 | + */ |
|
| 39 | + function redux_my_custom_field( array $field, $value ) { |
|
| 40 | + print_r( $field ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions |
|
| 41 | + echo '<br/>'; |
|
| 42 | + print_r( $value ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions |
|
| 43 | + } |
|
| 44 | 44 | } |
| 45 | 45 | // phpcs:enable |
@@ -10,262 +10,262 @@ discard block |
||
| 10 | 10 | defined( 'ABSPATH' ) || exit; |
| 11 | 11 | |
| 12 | 12 | Redux::set_section( |
| 13 | - $opt_name, |
|
| 14 | - array( |
|
| 15 | - 'title' => esc_html__( 'Select', 'your-textdomain-here' ), |
|
| 16 | - 'id' => 'select-select', |
|
| 17 | - '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>', |
|
| 18 | - 'subsection' => true, |
|
| 19 | - 'fields' => array( |
|
| 20 | - array( |
|
| 21 | - 'id' => 'opt-select', |
|
| 22 | - 'type' => 'select', |
|
| 23 | - 'title' => esc_html__( 'Select Option', 'your-textdomain-here' ), |
|
| 24 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 25 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 13 | + $opt_name, |
|
| 14 | + array( |
|
| 15 | + 'title' => esc_html__( 'Select', 'your-textdomain-here' ), |
|
| 16 | + 'id' => 'select-select', |
|
| 17 | + '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>', |
|
| 18 | + 'subsection' => true, |
|
| 19 | + 'fields' => array( |
|
| 20 | + array( |
|
| 21 | + 'id' => 'opt-select', |
|
| 22 | + 'type' => 'select', |
|
| 23 | + 'title' => esc_html__( 'Select Option', 'your-textdomain-here' ), |
|
| 24 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 25 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 26 | 26 | |
| 27 | - // Must provide key => value pairs for select options. |
|
| 28 | - 'options' => array( |
|
| 29 | - '1' => 'Opt 1', |
|
| 30 | - '2' => 'Opt 2', |
|
| 31 | - '3' => 'Opt 3', |
|
| 32 | - ), |
|
| 33 | - 'default' => '2', |
|
| 34 | - ), |
|
| 35 | - array( |
|
| 36 | - 'id' => 'opt-select-stylesheet', |
|
| 37 | - 'type' => 'select', |
|
| 38 | - 'title' => esc_html__( 'Theme Stylesheet', 'your-textdomain-here' ), |
|
| 39 | - 'subtitle' => esc_html__( 'Select your themes alternative color scheme.', 'your-textdomain-here' ), |
|
| 40 | - 'options' => array( |
|
| 41 | - 'default.css' => 'default.css', |
|
| 42 | - 'color1.css' => 'color1.css', |
|
| 43 | - ), |
|
| 44 | - 'default' => 'default.css', |
|
| 45 | - ), |
|
| 46 | - array( |
|
| 47 | - 'id' => 'opt-select-optgroup', |
|
| 48 | - 'type' => 'select', |
|
| 49 | - 'title' => esc_html__( 'Select Option with optgroup', 'your-textdomain-here' ), |
|
| 50 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 51 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 27 | + // Must provide key => value pairs for select options. |
|
| 28 | + 'options' => array( |
|
| 29 | + '1' => 'Opt 1', |
|
| 30 | + '2' => 'Opt 2', |
|
| 31 | + '3' => 'Opt 3', |
|
| 32 | + ), |
|
| 33 | + 'default' => '2', |
|
| 34 | + ), |
|
| 35 | + array( |
|
| 36 | + 'id' => 'opt-select-stylesheet', |
|
| 37 | + 'type' => 'select', |
|
| 38 | + 'title' => esc_html__( 'Theme Stylesheet', 'your-textdomain-here' ), |
|
| 39 | + 'subtitle' => esc_html__( 'Select your themes alternative color scheme.', 'your-textdomain-here' ), |
|
| 40 | + 'options' => array( |
|
| 41 | + 'default.css' => 'default.css', |
|
| 42 | + 'color1.css' => 'color1.css', |
|
| 43 | + ), |
|
| 44 | + 'default' => 'default.css', |
|
| 45 | + ), |
|
| 46 | + array( |
|
| 47 | + 'id' => 'opt-select-optgroup', |
|
| 48 | + 'type' => 'select', |
|
| 49 | + 'title' => esc_html__( 'Select Option with optgroup', 'your-textdomain-here' ), |
|
| 50 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 51 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 52 | 52 | |
| 53 | - // Must provide key => value pairs for select options. |
|
| 54 | - 'options' => array( |
|
| 55 | - 'Group 1' => array( |
|
| 56 | - '1' => 'Opt 1', |
|
| 57 | - '2' => 'Opt 2', |
|
| 58 | - '3' => 'Opt 3', |
|
| 59 | - ), |
|
| 60 | - 'Group 2' => array( |
|
| 61 | - '4' => 'Opt 4', |
|
| 62 | - '5' => 'Opt 5', |
|
| 63 | - '6' => 'Opt 6', |
|
| 64 | - ), |
|
| 65 | - '7' => 'Opt 7', |
|
| 66 | - '8' => 'Opt 8', |
|
| 67 | - '9' => 'Opt 9', |
|
| 68 | - ), |
|
| 69 | - 'default' => '2', |
|
| 70 | - ), |
|
| 71 | - array( |
|
| 72 | - 'id' => 'opt-multi-select', |
|
| 73 | - 'type' => 'select', |
|
| 74 | - 'multi' => true, |
|
| 75 | - 'title' => esc_html__( 'Multi Select Option', 'your-textdomain-here' ), |
|
| 76 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 77 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 53 | + // Must provide key => value pairs for select options. |
|
| 54 | + 'options' => array( |
|
| 55 | + 'Group 1' => array( |
|
| 56 | + '1' => 'Opt 1', |
|
| 57 | + '2' => 'Opt 2', |
|
| 58 | + '3' => 'Opt 3', |
|
| 59 | + ), |
|
| 60 | + 'Group 2' => array( |
|
| 61 | + '4' => 'Opt 4', |
|
| 62 | + '5' => 'Opt 5', |
|
| 63 | + '6' => 'Opt 6', |
|
| 64 | + ), |
|
| 65 | + '7' => 'Opt 7', |
|
| 66 | + '8' => 'Opt 8', |
|
| 67 | + '9' => 'Opt 9', |
|
| 68 | + ), |
|
| 69 | + 'default' => '2', |
|
| 70 | + ), |
|
| 71 | + array( |
|
| 72 | + 'id' => 'opt-multi-select', |
|
| 73 | + 'type' => 'select', |
|
| 74 | + 'multi' => true, |
|
| 75 | + 'title' => esc_html__( 'Multi Select Option', 'your-textdomain-here' ), |
|
| 76 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 77 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 78 | 78 | |
| 79 | - // Must provide key => value pairs for radio options. |
|
| 80 | - 'options' => array( |
|
| 81 | - '1' => 'Opt 1', |
|
| 82 | - '2' => 'Opt 2', |
|
| 83 | - '3' => 'Opt 3', |
|
| 84 | - ), |
|
| 85 | - 'default' => array( '2', '3' ), |
|
| 86 | - ), |
|
| 87 | - array( |
|
| 88 | - 'id' => 'opt-info', |
|
| 89 | - 'type' => 'info', |
|
| 90 | - 'desc' => esc_html__( 'You can easily add a variety of data from WordPress.', 'your-textdomain-here' ), |
|
| 91 | - ), |
|
| 92 | - array( |
|
| 93 | - 'id' => 'opt-select-categories', |
|
| 94 | - 'type' => 'select', |
|
| 95 | - 'data' => 'roles', |
|
| 96 | - 'title' => esc_html__( 'Categories Select Option', 'your-textdomain-here' ), |
|
| 97 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 98 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 99 | - ), |
|
| 100 | - array( |
|
| 101 | - 'id' => 'opt-select-categories-multi', |
|
| 102 | - 'type' => 'select', |
|
| 103 | - 'data' => 'categories', |
|
| 104 | - 'multi' => true, |
|
| 105 | - 'title' => esc_html__( 'Categories Multi Select Option', 'your-textdomain-here' ), |
|
| 106 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 107 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 108 | - ), |
|
| 109 | - array( |
|
| 110 | - 'id' => 'opt-select-pages', |
|
| 111 | - 'type' => 'select', |
|
| 112 | - 'data' => 'pages', |
|
| 113 | - 'title' => esc_html__( 'Pages Select Option', 'your-textdomain-here' ), |
|
| 114 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 115 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 116 | - ), |
|
| 117 | - array( |
|
| 118 | - 'id' => 'opt-multi-select-pages', |
|
| 119 | - 'type' => 'select', |
|
| 120 | - 'data' => 'pages', |
|
| 121 | - 'multi' => true, |
|
| 122 | - 'title' => esc_html__( 'Pages Multi Select Option', 'your-textdomain-here' ), |
|
| 123 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 124 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 125 | - ), |
|
| 126 | - array( |
|
| 127 | - 'id' => 'opt-select-tags', |
|
| 128 | - 'type' => 'select', |
|
| 129 | - 'data' => 'tags', |
|
| 130 | - 'title' => esc_html__( 'Tags Select Option', 'your-textdomain-here' ), |
|
| 131 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 132 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 133 | - ), |
|
| 134 | - array( |
|
| 135 | - 'id' => 'opt-multi-select-tags', |
|
| 136 | - 'type' => 'select', |
|
| 137 | - 'data' => 'terms', |
|
| 138 | - 'multi' => true, |
|
| 139 | - 'title' => esc_html__( 'Tags Multi Select Option', 'your-textdomain-here' ), |
|
| 140 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 141 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 142 | - ), |
|
| 143 | - array( |
|
| 144 | - 'id' => 'opt-select-terms', |
|
| 145 | - 'type' => 'select', |
|
| 146 | - 'data' => 'terms', |
|
| 147 | - 'title' => esc_html__( 'Terms Select Option', 'your-textdomain-here' ), |
|
| 148 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 149 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 150 | - ), |
|
| 151 | - array( |
|
| 152 | - 'id' => 'opt-multi-select-terms', |
|
| 153 | - 'type' => 'select', |
|
| 154 | - 'data' => 'terms', |
|
| 155 | - 'multi' => true, |
|
| 156 | - 'title' => esc_html__( 'Terms Multi Select Option', 'your-textdomain-here' ), |
|
| 157 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 158 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 159 | - ), |
|
| 160 | - array( |
|
| 161 | - 'id' => 'opt-select-menus', |
|
| 162 | - 'type' => 'select', |
|
| 163 | - 'data' => 'menus', |
|
| 164 | - 'title' => esc_html__( 'Menus Select Option', 'your-textdomain-here' ), |
|
| 165 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 166 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 167 | - ), |
|
| 168 | - array( |
|
| 169 | - 'id' => 'opt-multi-select-menus', |
|
| 170 | - 'type' => 'select', |
|
| 171 | - 'data' => 'menu', |
|
| 172 | - 'multi' => true, |
|
| 173 | - 'title' => esc_html__( 'Menus Multi Select Option', 'your-textdomain-here' ), |
|
| 174 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 175 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 176 | - ), |
|
| 177 | - array( |
|
| 178 | - 'id' => 'opt-select-post-type', |
|
| 179 | - 'type' => 'select', |
|
| 180 | - 'data' => 'post_type', |
|
| 181 | - 'title' => esc_html__( 'Post Type Select Option', 'your-textdomain-here' ), |
|
| 182 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 183 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 184 | - ), |
|
| 185 | - array( |
|
| 186 | - 'id' => 'opt-multi-select-post-type', |
|
| 187 | - 'type' => 'select', |
|
| 188 | - 'data' => 'post_type', |
|
| 189 | - 'multi' => true, |
|
| 190 | - 'title' => esc_html__( 'Post Type Multi Select Option', 'your-textdomain-here' ), |
|
| 191 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 192 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 193 | - ), |
|
| 194 | - array( |
|
| 195 | - 'id' => 'opt-multi-select-sortable', |
|
| 196 | - 'type' => 'select', |
|
| 197 | - 'data' => 'post_type', |
|
| 198 | - 'multi' => true, |
|
| 199 | - 'sortable' => true, |
|
| 200 | - 'title' => esc_html__( 'Post Type Multi Select Option + Sortable', 'your-textdomain-here' ), |
|
| 201 | - 'subtitle' => esc_html__( 'This field also has sortable enabled!', 'your-textdomain-here' ), |
|
| 202 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 203 | - ), |
|
| 204 | - array( |
|
| 205 | - 'id' => 'opt-select-posts', |
|
| 206 | - 'type' => 'select', |
|
| 207 | - 'data' => 'post', |
|
| 208 | - 'title' => esc_html__( 'Posts Select Option2', 'your-textdomain-here' ), |
|
| 209 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 210 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 211 | - ), |
|
| 212 | - array( |
|
| 213 | - 'id' => 'opt-multi-select-posts', |
|
| 214 | - 'type' => 'select', |
|
| 215 | - 'data' => 'post', |
|
| 216 | - 'multi' => true, |
|
| 217 | - 'title' => esc_html__( 'Posts Multi Select Option', 'your-textdomain-here' ), |
|
| 218 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 219 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 220 | - ), |
|
| 221 | - array( |
|
| 222 | - 'id' => 'opt-select-roles', |
|
| 223 | - 'type' => 'select', |
|
| 224 | - 'data' => 'roles', |
|
| 225 | - 'title' => esc_html__( 'User Role Select Option', 'your-textdomain-here' ), |
|
| 226 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 227 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 228 | - ), |
|
| 229 | - array( |
|
| 230 | - 'id' => 'opt-select-capabilities', |
|
| 231 | - 'type' => 'select', |
|
| 232 | - 'data' => 'capabilities', |
|
| 233 | - 'multi' => false, |
|
| 234 | - 'ajax' => true, |
|
| 235 | - 'min_input_length' => 3, |
|
| 236 | - 'title' => esc_html__( 'Capabilities Select Option w/ AJAX Loading', 'your-textdomain-here' ), |
|
| 237 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 238 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 239 | - ), |
|
| 240 | - array( |
|
| 241 | - 'id' => 'opt-select-elusive', |
|
| 242 | - 'type' => 'select', |
|
| 243 | - 'data' => 'elusive-icons', |
|
| 244 | - 'title' => esc_html__( 'Elusive Icons Select Option', 'your-textdomain-here' ), |
|
| 245 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 246 | - 'desc' => esc_html__( 'Here\'s a list of all the elusive icons by name and icon.', 'your-textdomain-here' ), |
|
| 247 | - ), |
|
| 248 | - array( |
|
| 249 | - 'id' => 'opt-select-users', |
|
| 250 | - 'type' => 'select', |
|
| 251 | - 'data' => 'users', |
|
| 252 | - 'ajax' => true, |
|
| 253 | - 'min_input_length' => 3, |
|
| 254 | - 'title' => esc_html__( 'Users Select Option', 'your-textdomain-here' ), |
|
| 255 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 256 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 257 | - ), |
|
| 258 | - array( |
|
| 259 | - 'id' => 'opt-select-callback', |
|
| 260 | - 'type' => 'select', |
|
| 261 | - 'data' => 'callback', |
|
| 262 | - 'args' => 'redux_select_callback', |
|
| 263 | - 'title' => esc_html__( 'Select Option using a Callback', 'your-textdomain-here' ), |
|
| 264 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 265 | - 'desc' => esc_html__( 'The items in this select were added via a callback function.', 'your-textdomain-here' ), |
|
| 266 | - ), |
|
| 267 | - ), |
|
| 268 | - ) |
|
| 79 | + // Must provide key => value pairs for radio options. |
|
| 80 | + 'options' => array( |
|
| 81 | + '1' => 'Opt 1', |
|
| 82 | + '2' => 'Opt 2', |
|
| 83 | + '3' => 'Opt 3', |
|
| 84 | + ), |
|
| 85 | + 'default' => array( '2', '3' ), |
|
| 86 | + ), |
|
| 87 | + array( |
|
| 88 | + 'id' => 'opt-info', |
|
| 89 | + 'type' => 'info', |
|
| 90 | + 'desc' => esc_html__( 'You can easily add a variety of data from WordPress.', 'your-textdomain-here' ), |
|
| 91 | + ), |
|
| 92 | + array( |
|
| 93 | + 'id' => 'opt-select-categories', |
|
| 94 | + 'type' => 'select', |
|
| 95 | + 'data' => 'roles', |
|
| 96 | + 'title' => esc_html__( 'Categories Select Option', 'your-textdomain-here' ), |
|
| 97 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 98 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 99 | + ), |
|
| 100 | + array( |
|
| 101 | + 'id' => 'opt-select-categories-multi', |
|
| 102 | + 'type' => 'select', |
|
| 103 | + 'data' => 'categories', |
|
| 104 | + 'multi' => true, |
|
| 105 | + 'title' => esc_html__( 'Categories Multi Select Option', 'your-textdomain-here' ), |
|
| 106 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 107 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 108 | + ), |
|
| 109 | + array( |
|
| 110 | + 'id' => 'opt-select-pages', |
|
| 111 | + 'type' => 'select', |
|
| 112 | + 'data' => 'pages', |
|
| 113 | + 'title' => esc_html__( 'Pages Select Option', 'your-textdomain-here' ), |
|
| 114 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 115 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 116 | + ), |
|
| 117 | + array( |
|
| 118 | + 'id' => 'opt-multi-select-pages', |
|
| 119 | + 'type' => 'select', |
|
| 120 | + 'data' => 'pages', |
|
| 121 | + 'multi' => true, |
|
| 122 | + 'title' => esc_html__( 'Pages Multi Select Option', 'your-textdomain-here' ), |
|
| 123 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 124 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 125 | + ), |
|
| 126 | + array( |
|
| 127 | + 'id' => 'opt-select-tags', |
|
| 128 | + 'type' => 'select', |
|
| 129 | + 'data' => 'tags', |
|
| 130 | + 'title' => esc_html__( 'Tags Select Option', 'your-textdomain-here' ), |
|
| 131 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 132 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 133 | + ), |
|
| 134 | + array( |
|
| 135 | + 'id' => 'opt-multi-select-tags', |
|
| 136 | + 'type' => 'select', |
|
| 137 | + 'data' => 'terms', |
|
| 138 | + 'multi' => true, |
|
| 139 | + 'title' => esc_html__( 'Tags Multi Select Option', 'your-textdomain-here' ), |
|
| 140 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 141 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 142 | + ), |
|
| 143 | + array( |
|
| 144 | + 'id' => 'opt-select-terms', |
|
| 145 | + 'type' => 'select', |
|
| 146 | + 'data' => 'terms', |
|
| 147 | + 'title' => esc_html__( 'Terms Select Option', 'your-textdomain-here' ), |
|
| 148 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 149 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 150 | + ), |
|
| 151 | + array( |
|
| 152 | + 'id' => 'opt-multi-select-terms', |
|
| 153 | + 'type' => 'select', |
|
| 154 | + 'data' => 'terms', |
|
| 155 | + 'multi' => true, |
|
| 156 | + 'title' => esc_html__( 'Terms Multi Select Option', 'your-textdomain-here' ), |
|
| 157 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 158 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 159 | + ), |
|
| 160 | + array( |
|
| 161 | + 'id' => 'opt-select-menus', |
|
| 162 | + 'type' => 'select', |
|
| 163 | + 'data' => 'menus', |
|
| 164 | + 'title' => esc_html__( 'Menus Select Option', 'your-textdomain-here' ), |
|
| 165 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 166 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 167 | + ), |
|
| 168 | + array( |
|
| 169 | + 'id' => 'opt-multi-select-menus', |
|
| 170 | + 'type' => 'select', |
|
| 171 | + 'data' => 'menu', |
|
| 172 | + 'multi' => true, |
|
| 173 | + 'title' => esc_html__( 'Menus Multi Select Option', 'your-textdomain-here' ), |
|
| 174 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 175 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 176 | + ), |
|
| 177 | + array( |
|
| 178 | + 'id' => 'opt-select-post-type', |
|
| 179 | + 'type' => 'select', |
|
| 180 | + 'data' => 'post_type', |
|
| 181 | + 'title' => esc_html__( 'Post Type Select Option', 'your-textdomain-here' ), |
|
| 182 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 183 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 184 | + ), |
|
| 185 | + array( |
|
| 186 | + 'id' => 'opt-multi-select-post-type', |
|
| 187 | + 'type' => 'select', |
|
| 188 | + 'data' => 'post_type', |
|
| 189 | + 'multi' => true, |
|
| 190 | + 'title' => esc_html__( 'Post Type Multi Select Option', 'your-textdomain-here' ), |
|
| 191 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 192 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 193 | + ), |
|
| 194 | + array( |
|
| 195 | + 'id' => 'opt-multi-select-sortable', |
|
| 196 | + 'type' => 'select', |
|
| 197 | + 'data' => 'post_type', |
|
| 198 | + 'multi' => true, |
|
| 199 | + 'sortable' => true, |
|
| 200 | + 'title' => esc_html__( 'Post Type Multi Select Option + Sortable', 'your-textdomain-here' ), |
|
| 201 | + 'subtitle' => esc_html__( 'This field also has sortable enabled!', 'your-textdomain-here' ), |
|
| 202 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 203 | + ), |
|
| 204 | + array( |
|
| 205 | + 'id' => 'opt-select-posts', |
|
| 206 | + 'type' => 'select', |
|
| 207 | + 'data' => 'post', |
|
| 208 | + 'title' => esc_html__( 'Posts Select Option2', 'your-textdomain-here' ), |
|
| 209 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 210 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 211 | + ), |
|
| 212 | + array( |
|
| 213 | + 'id' => 'opt-multi-select-posts', |
|
| 214 | + 'type' => 'select', |
|
| 215 | + 'data' => 'post', |
|
| 216 | + 'multi' => true, |
|
| 217 | + 'title' => esc_html__( 'Posts Multi Select Option', 'your-textdomain-here' ), |
|
| 218 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 219 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 220 | + ), |
|
| 221 | + array( |
|
| 222 | + 'id' => 'opt-select-roles', |
|
| 223 | + 'type' => 'select', |
|
| 224 | + 'data' => 'roles', |
|
| 225 | + 'title' => esc_html__( 'User Role Select Option', 'your-textdomain-here' ), |
|
| 226 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 227 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 228 | + ), |
|
| 229 | + array( |
|
| 230 | + 'id' => 'opt-select-capabilities', |
|
| 231 | + 'type' => 'select', |
|
| 232 | + 'data' => 'capabilities', |
|
| 233 | + 'multi' => false, |
|
| 234 | + 'ajax' => true, |
|
| 235 | + 'min_input_length' => 3, |
|
| 236 | + 'title' => esc_html__( 'Capabilities Select Option w/ AJAX Loading', 'your-textdomain-here' ), |
|
| 237 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 238 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 239 | + ), |
|
| 240 | + array( |
|
| 241 | + 'id' => 'opt-select-elusive', |
|
| 242 | + 'type' => 'select', |
|
| 243 | + 'data' => 'elusive-icons', |
|
| 244 | + 'title' => esc_html__( 'Elusive Icons Select Option', 'your-textdomain-here' ), |
|
| 245 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 246 | + 'desc' => esc_html__( 'Here\'s a list of all the elusive icons by name and icon.', 'your-textdomain-here' ), |
|
| 247 | + ), |
|
| 248 | + array( |
|
| 249 | + 'id' => 'opt-select-users', |
|
| 250 | + 'type' => 'select', |
|
| 251 | + 'data' => 'users', |
|
| 252 | + 'ajax' => true, |
|
| 253 | + 'min_input_length' => 3, |
|
| 254 | + 'title' => esc_html__( 'Users Select Option', 'your-textdomain-here' ), |
|
| 255 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 256 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 257 | + ), |
|
| 258 | + array( |
|
| 259 | + 'id' => 'opt-select-callback', |
|
| 260 | + 'type' => 'select', |
|
| 261 | + 'data' => 'callback', |
|
| 262 | + 'args' => 'redux_select_callback', |
|
| 263 | + 'title' => esc_html__( 'Select Option using a Callback', 'your-textdomain-here' ), |
|
| 264 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 265 | + 'desc' => esc_html__( 'The items in this select were added via a callback function.', 'your-textdomain-here' ), |
|
| 266 | + ), |
|
| 267 | + ), |
|
| 268 | + ) |
|
| 269 | 269 | ); |
| 270 | 270 | |
| 271 | 271 | /** |
@@ -274,13 +274,13 @@ discard block |
||
| 274 | 274 | * @return array |
| 275 | 275 | */ |
| 276 | 276 | function redux_select_callback(): array { |
| 277 | - $options = array(); |
|
| 277 | + $options = array(); |
|
| 278 | 278 | |
| 279 | - $options[0] = esc_html__( 'Zero', 'your-textdomain-here' ); |
|
| 280 | - $options[1] = esc_html__( 'One', 'your-textdomain-here' ); |
|
| 281 | - $options[2] = esc_html__( 'Two', 'your-textdomain-here' ); |
|
| 282 | - $options[3] = esc_html__( 'Three', 'your-textdomain-here' ); |
|
| 279 | + $options[0] = esc_html__( 'Zero', 'your-textdomain-here' ); |
|
| 280 | + $options[1] = esc_html__( 'One', 'your-textdomain-here' ); |
|
| 281 | + $options[2] = esc_html__( 'Two', 'your-textdomain-here' ); |
|
| 282 | + $options[3] = esc_html__( 'Three', 'your-textdomain-here' ); |
|
| 283 | 283 | |
| 284 | - return $options; |
|
| 284 | + return $options; |
|
| 285 | 285 | } |
| 286 | 286 | // phpcs:enable |
@@ -10,113 +10,113 @@ |
||
| 10 | 10 | defined( 'ABSPATH' ) || exit; |
| 11 | 11 | |
| 12 | 12 | Redux::set_section( |
| 13 | - $opt_name, |
|
| 14 | - array( |
|
| 15 | - 'title' => esc_html__( 'Image Select', 'your-textdomain-here' ), |
|
| 16 | - 'id' => 'select-image_select', |
|
| 17 | - '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>', |
|
| 18 | - 'subsection' => true, |
|
| 19 | - 'fields' => array( |
|
| 20 | - array( |
|
| 21 | - 'id' => 'opt-image-select-layout', |
|
| 22 | - 'type' => 'image_select', |
|
| 23 | - 'title' => esc_html__( 'Images Option for Layout', 'your-textdomain-here' ), |
|
| 24 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 25 | - 'desc' => esc_html__( 'This uses some of the built in images, you can use them for layout options.', 'your-textdomain-here' ), |
|
| 13 | + $opt_name, |
|
| 14 | + array( |
|
| 15 | + 'title' => esc_html__( 'Image Select', 'your-textdomain-here' ), |
|
| 16 | + 'id' => 'select-image_select', |
|
| 17 | + '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>', |
|
| 18 | + 'subsection' => true, |
|
| 19 | + 'fields' => array( |
|
| 20 | + array( |
|
| 21 | + 'id' => 'opt-image-select-layout', |
|
| 22 | + 'type' => 'image_select', |
|
| 23 | + 'title' => esc_html__( 'Images Option for Layout', 'your-textdomain-here' ), |
|
| 24 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 25 | + 'desc' => esc_html__( 'This uses some of the built in images, you can use them for layout options.', 'your-textdomain-here' ), |
|
| 26 | 26 | |
| 27 | - // Must provide key => value(array:title|img) pairs for radio options. |
|
| 28 | - 'options' => array( |
|
| 29 | - '1' => array( |
|
| 30 | - 'alt' => '1 Column', |
|
| 31 | - 'img' => Redux_Core::$url . 'assets/img/1col.png', |
|
| 32 | - ), |
|
| 33 | - '2' => array( |
|
| 34 | - 'alt' => '2 Column Left', |
|
| 35 | - 'img' => Redux_Core::$url . 'assets/img/2cl.png', |
|
| 36 | - ), |
|
| 37 | - '3' => array( |
|
| 38 | - 'alt' => '2 Column Right', |
|
| 39 | - 'img' => Redux_Core::$url . 'assets/img/2cr.png', |
|
| 40 | - ), |
|
| 41 | - '4' => array( |
|
| 42 | - 'alt' => '3 Column Middle', |
|
| 43 | - 'img' => Redux_Core::$url . 'assets/img/3cm.png', |
|
| 44 | - ), |
|
| 45 | - '5' => array( |
|
| 46 | - 'alt' => '3 Column Left', |
|
| 47 | - 'img' => Redux_Core::$url . 'assets/img/3cl.png', |
|
| 48 | - ), |
|
| 49 | - '6' => array( |
|
| 50 | - 'alt' => '3 Column Right', |
|
| 51 | - 'img' => Redux_Core::$url . 'assets/img/3cr.png', |
|
| 52 | - ), |
|
| 53 | - ), |
|
| 54 | - 'default' => '2', |
|
| 55 | - ), |
|
| 56 | - array( |
|
| 57 | - 'id' => 'opt-patterns', |
|
| 58 | - 'type' => 'image_select', |
|
| 59 | - 'tiles' => true, |
|
| 60 | - 'title' => esc_html__( 'Images Option (with tiles => true)', 'your-textdomain-here' ), |
|
| 61 | - 'subtitle' => esc_html__( 'Select a background pattern.', 'your-textdomain-here' ), |
|
| 62 | - 'default' => 0, |
|
| 63 | - 'options' => $sample_patterns, |
|
| 64 | - ), |
|
| 65 | - array( |
|
| 66 | - 'id' => 'opt-image-select', |
|
| 67 | - 'type' => 'image_select', |
|
| 68 | - 'title' => esc_html__( 'Images Option', 'your-textdomain-here' ), |
|
| 69 | - 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 70 | - 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 27 | + // Must provide key => value(array:title|img) pairs for radio options. |
|
| 28 | + 'options' => array( |
|
| 29 | + '1' => array( |
|
| 30 | + 'alt' => '1 Column', |
|
| 31 | + 'img' => Redux_Core::$url . 'assets/img/1col.png', |
|
| 32 | + ), |
|
| 33 | + '2' => array( |
|
| 34 | + 'alt' => '2 Column Left', |
|
| 35 | + 'img' => Redux_Core::$url . 'assets/img/2cl.png', |
|
| 36 | + ), |
|
| 37 | + '3' => array( |
|
| 38 | + 'alt' => '2 Column Right', |
|
| 39 | + 'img' => Redux_Core::$url . 'assets/img/2cr.png', |
|
| 40 | + ), |
|
| 41 | + '4' => array( |
|
| 42 | + 'alt' => '3 Column Middle', |
|
| 43 | + 'img' => Redux_Core::$url . 'assets/img/3cm.png', |
|
| 44 | + ), |
|
| 45 | + '5' => array( |
|
| 46 | + 'alt' => '3 Column Left', |
|
| 47 | + 'img' => Redux_Core::$url . 'assets/img/3cl.png', |
|
| 48 | + ), |
|
| 49 | + '6' => array( |
|
| 50 | + 'alt' => '3 Column Right', |
|
| 51 | + 'img' => Redux_Core::$url . 'assets/img/3cr.png', |
|
| 52 | + ), |
|
| 53 | + ), |
|
| 54 | + 'default' => '2', |
|
| 55 | + ), |
|
| 56 | + array( |
|
| 57 | + 'id' => 'opt-patterns', |
|
| 58 | + 'type' => 'image_select', |
|
| 59 | + 'tiles' => true, |
|
| 60 | + 'title' => esc_html__( 'Images Option (with tiles => true)', 'your-textdomain-here' ), |
|
| 61 | + 'subtitle' => esc_html__( 'Select a background pattern.', 'your-textdomain-here' ), |
|
| 62 | + 'default' => 0, |
|
| 63 | + 'options' => $sample_patterns, |
|
| 64 | + ), |
|
| 65 | + array( |
|
| 66 | + 'id' => 'opt-image-select', |
|
| 67 | + 'type' => 'image_select', |
|
| 68 | + 'title' => esc_html__( 'Images Option', 'your-textdomain-here' ), |
|
| 69 | + 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), |
|
| 70 | + 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), |
|
| 71 | 71 | |
| 72 | - // Must provide key => value(array:title|img) pairs for radio options. |
|
| 73 | - 'options' => array( |
|
| 74 | - '1' => array( |
|
| 75 | - 'title' => 'Opt 1', |
|
| 76 | - 'img' => admin_url() . 'images/align-none.png', |
|
| 77 | - ), |
|
| 78 | - '2' => array( |
|
| 79 | - 'title' => 'Opt 2', |
|
| 80 | - 'img' => admin_url() . 'images/align-left.png', |
|
| 81 | - ), |
|
| 82 | - '3' => array( |
|
| 83 | - 'title' => 'Opt 3', |
|
| 84 | - 'img' => admin_url() . 'images/align-center.png', |
|
| 85 | - ), |
|
| 86 | - '4' => array( |
|
| 87 | - 'title' => 'Opt 4', |
|
| 88 | - 'img' => admin_url() . 'images/align-right.png', |
|
| 89 | - ), |
|
| 90 | - ), |
|
| 91 | - 'default' => '2', |
|
| 92 | - ), |
|
| 93 | - array( |
|
| 94 | - 'id' => 'opt-presets', |
|
| 95 | - 'type' => 'image_select', |
|
| 96 | - 'presets' => true, |
|
| 97 | - 'full_width' => true, |
|
| 98 | - 'title' => esc_html__( 'Preset', 'your-textdomain-here' ), |
|
| 99 | - 'subtitle' => esc_html__( 'This allows you to set a json string or array to override multiple preferences in your theme.', 'your-textdomain-here' ), |
|
| 100 | - 'default' => 0, |
|
| 101 | - 'desc' => esc_html__( 'This allows you to set a json string or array to override multiple preferences in your theme.', 'your-textdomain-here' ), |
|
| 102 | - 'options' => array( |
|
| 103 | - '1' => array( |
|
| 104 | - 'alt' => 'Preset 1', |
|
| 105 | - 'img' => Redux_Core::$url . '../sample/presets/preset1.png', |
|
| 106 | - 'presets' => array( |
|
| 107 | - 'switch-on' => 1, |
|
| 108 | - 'switch-off' => 1, |
|
| 109 | - 'switch-parent' => 1, |
|
| 110 | - ), |
|
| 111 | - ), |
|
| 112 | - '2' => array( |
|
| 113 | - 'alt' => 'Preset 2', |
|
| 114 | - 'img' => Redux_Core::$url . '../sample/presets/preset2.png', |
|
| 115 | - 'presets' => '{"opt-slider-label":"1", "opt-slider-text":"10"}', |
|
| 116 | - ), |
|
| 117 | - ), |
|
| 118 | - ), |
|
| 119 | - ), |
|
| 120 | - ) |
|
| 72 | + // Must provide key => value(array:title|img) pairs for radio options. |
|
| 73 | + 'options' => array( |
|
| 74 | + '1' => array( |
|
| 75 | + 'title' => 'Opt 1', |
|
| 76 | + 'img' => admin_url() . 'images/align-none.png', |
|
| 77 | + ), |
|
| 78 | + '2' => array( |
|
| 79 | + 'title' => 'Opt 2', |
|
| 80 | + 'img' => admin_url() . 'images/align-left.png', |
|
| 81 | + ), |
|
| 82 | + '3' => array( |
|
| 83 | + 'title' => 'Opt 3', |
|
| 84 | + 'img' => admin_url() . 'images/align-center.png', |
|
| 85 | + ), |
|
| 86 | + '4' => array( |
|
| 87 | + 'title' => 'Opt 4', |
|
| 88 | + 'img' => admin_url() . 'images/align-right.png', |
|
| 89 | + ), |
|
| 90 | + ), |
|
| 91 | + 'default' => '2', |
|
| 92 | + ), |
|
| 93 | + array( |
|
| 94 | + 'id' => 'opt-presets', |
|
| 95 | + 'type' => 'image_select', |
|
| 96 | + 'presets' => true, |
|
| 97 | + 'full_width' => true, |
|
| 98 | + 'title' => esc_html__( 'Preset', 'your-textdomain-here' ), |
|
| 99 | + 'subtitle' => esc_html__( 'This allows you to set a json string or array to override multiple preferences in your theme.', 'your-textdomain-here' ), |
|
| 100 | + 'default' => 0, |
|
| 101 | + 'desc' => esc_html__( 'This allows you to set a json string or array to override multiple preferences in your theme.', 'your-textdomain-here' ), |
|
| 102 | + 'options' => array( |
|
| 103 | + '1' => array( |
|
| 104 | + 'alt' => 'Preset 1', |
|
| 105 | + 'img' => Redux_Core::$url . '../sample/presets/preset1.png', |
|
| 106 | + 'presets' => array( |
|
| 107 | + 'switch-on' => 1, |
|
| 108 | + 'switch-off' => 1, |
|
| 109 | + 'switch-parent' => 1, |
|
| 110 | + ), |
|
| 111 | + ), |
|
| 112 | + '2' => array( |
|
| 113 | + 'alt' => 'Preset 2', |
|
| 114 | + 'img' => Redux_Core::$url . '../sample/presets/preset2.png', |
|
| 115 | + 'presets' => '{"opt-slider-label":"1", "opt-slider-text":"10"}', |
|
| 116 | + ), |
|
| 117 | + ), |
|
| 118 | + ), |
|
| 119 | + ), |
|
| 120 | + ) |
|
| 121 | 121 | ); |
| 122 | 122 | // phpcs:enable |