image-select.php (4204B)
1 <?php 2 /** 3 * Redux Framework image select config. 4 * For full documentation, please visit: http://devs.redux.io/ 5 * 6 * @package Redux Framework 7 */ 8 9 defined( 'ABSPATH' ) || exit; 10 11 Redux::set_section( 12 $opt_name, 13 array( 14 'title' => esc_html__( 'Image Select', 'your-textdomain-here' ), 15 'id' => 'select-image_select', 16 '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>', 17 'subsection' => true, 18 'fields' => array( 19 array( 20 'id' => 'opt-image-select-layout', 21 'type' => 'image_select', 22 'title' => esc_html__( 'Images Option for Layout', 'your-textdomain-here' ), 23 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), 24 'desc' => esc_html__( 'This uses some of the built in images, you can use them for layout options.', 'your-textdomain-here' ), 25 26 // Must provide key => value(array:title|img) pairs for radio options. 27 'options' => array( 28 '1' => array( 29 'alt' => '1 Column', 30 'img' => Redux_Core::$url . 'assets/img/1col.png', 31 ), 32 '2' => array( 33 'alt' => '2 Column Left', 34 'img' => Redux_Core::$url . 'assets/img/2cl.png', 35 ), 36 '3' => array( 37 'alt' => '2 Column Right', 38 'img' => Redux_Core::$url . 'assets/img/2cr.png', 39 ), 40 '4' => array( 41 'alt' => '3 Column Middle', 42 'img' => Redux_Core::$url . 'assets/img/3cm.png', 43 ), 44 '5' => array( 45 'alt' => '3 Column Left', 46 'img' => Redux_Core::$url . 'assets/img/3cl.png', 47 ), 48 '6' => array( 49 'alt' => '3 Column Right', 50 'img' => Redux_Core::$url . 'assets/img/3cr.png', 51 ), 52 ), 53 'default' => '2', 54 ), 55 array( 56 'id' => 'opt-patterns', 57 'type' => 'image_select', 58 'tiles' => true, 59 'title' => esc_html__( 'Images Option (with tiles => true)', 'your-textdomain-here' ), 60 'subtitle' => esc_html__( 'Select a background pattern.', 'your-textdomain-here' ), 61 'default' => 0, 62 'options' => $sample_patterns, 63 ), 64 array( 65 'id' => 'opt-image-select', 66 'type' => 'image_select', 67 'title' => esc_html__( 'Images Option', 'your-textdomain-here' ), 68 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), 69 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), 70 71 // Must provide key => value(array:title|img) pairs for radio options. 72 'options' => array( 73 '1' => array( 74 'title' => 'Opt 1', 75 'img' => admin_url() . 'images/align-none.png', 76 ), 77 '2' => array( 78 'title' => 'Opt 2', 79 'img' => admin_url() . 'images/align-left.png', 80 ), 81 '3' => array( 82 'title' => 'Opt 3', 83 'img' => admin_url() . 'images/align-center.png', 84 ), 85 '4' => array( 86 'title' => 'Opt 4', 87 'img' => admin_url() . 'images/align-right.png', 88 ), 89 ), 90 'default' => '2', 91 ), 92 array( 93 'id' => 'opt-presets', 94 'type' => 'image_select', 95 'presets' => true, 96 'full_width' => true, 97 'title' => esc_html__( 'Preset', 'your-textdomain-here' ), 98 'subtitle' => esc_html__( 'This allows you to set a json string or array to override multiple preferences in your theme.', 'your-textdomain-here' ), 99 'default' => 0, 100 'desc' => esc_html__( 'This allows you to set a json string or array to override multiple preferences in your theme.', 'your-textdomain-here' ), 101 'options' => array( 102 '1' => array( 103 'alt' => 'Preset 1', 104 'img' => Redux_Core::$url . '../sample/presets/preset1.png', 105 'presets' => array( 106 'switch-on' => 1, 107 'switch-off' => 1, 108 'switch-parent' => 1, 109 ), 110 ), 111 '2' => array( 112 'alt' => 'Preset 2', 113 'img' => Redux_Core::$url . '../sample/presets/preset2.png', 114 'presets' => '{"opt-slider-label":"1", "opt-slider-text":"10"}', 115 ), 116 ), 117 ), 118 ), 119 ) 120 );