checkbox.php (2619B)
1 <?php 2 /** 3 * Redux Framework checkbox 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__( 'Checkbox', 'your-textdomain-here' ), 15 'id' => 'basic-checkbox', 16 'subsection' => true, 17 'customizer_width' => '450px', 18 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-fields/checkbox.html" target="_blank">https://devs.redux.io/core-fields/checkbox.html</a>', 19 'fields' => array( 20 array( 21 'id' => 'opt-checkbox', 22 'type' => 'checkbox', 23 'title' => esc_html__( 'Checkbox 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 'default' => '1', // 1 = on | 0 = off. 27 ), 28 array( 29 'id' => 'opt-multi-check', 30 'type' => 'checkbox', 31 'title' => esc_html__( 'Multi Checkbox Option', 'your-textdomain-here' ), 32 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), 33 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), 34 35 // Must provide key => value pairs for multi checkbox options. 36 'options' => array( 37 '1' => 'Opt 1', 38 '2' => 'Opt 2', 39 '3' => 'Opt 3', 40 ), 41 'default' => array( 42 '1' => '1', 43 '2' => '0', 44 '3' => '0', 45 ), 46 ), 47 array( 48 'id' => 'opt-checkbox-data', 49 'type' => 'checkbox', 50 'title' => esc_html__( 'Multi Checkbox Option (with menu data)', 'your-textdomain-here' ), 51 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), 52 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), 53 'data' => 'menu', 54 ), 55 array( 56 'id' => 'opt-checkbox-sidebar', 57 'type' => 'checkbox', 58 'title' => esc_html__( 'Multi Checkbox Option (with sidebar data)', 'your-textdomain-here' ), 59 'subtitle' => esc_html__( 'No validation can be done on this field type', 'your-textdomain-here' ), 60 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), 61 'data' => 'sidebars', 62 ), 63 ), 64 ) 65 );