metaboxes.php (9318B)
1 <?php 2 /** 3 * Redux Framework Sample Metabox Config File 4 * For full documentation, please visit: http:https://devs.redux.io/ 5 * Metabox Lite support the following fields only: checkbox, radio, text, textarea, media, & color 6 * Post Format and Post Template options are not avaialble in Metabox Lite. 7 * These advanced options are available in Redux Pro. 8 * 9 * @package Redux Framework 10 */ 11 12 defined( 'ABSPATH' ) || exit; 13 14 if ( ! class_exists( 'Redux_Metaboxes' ) ) { 15 return; 16 } 17 18 Redux_Metaboxes::set_box( 19 $opt_name, 20 array( 21 'id' => 'opt-metaboxes', 22 'title' => esc_html__( 'Metabox Options', 'your-textdomain-here' ), 23 'post_types' => array( 'page', 'post' ), 24 'position' => 'normal', // normal, advanced, side. 25 'priority' => 'high', // high, core, default, low. 26 'sections' => array( 27 array( 28 'title' => esc_html__( 'Basic Fields', 'your-textdomain-here' ), 29 'id' => 'opt-basic-fields', 30 'desc' => esc_html__( 'Redux Framework was created with the developer in mind. It allows for any theme developer to have an advanced theme panel with most of the features a developer would need. For more information check out the Github repo at:', 'your-textdomain-here' ) . ' <a href="https://github.com/ReduxFramework/Redux-Framework">https://github.com/ReduxFramework/Redux-Framework</a>', 31 'icon' => 'el-icon-cogs', 32 'fields' => array( 33 array( 34 'id' => 'opt-checkbox', 35 'type' => 'checkbox', 36 'title' => esc_html__( 'Checkbox', 'your-textdomain-here' ), 37 'subtitle' => esc_html__( 'Basic Checkbox field.', 'your-textdomain-here' ), 38 'default' => true, 39 ), 40 array( 41 'id' => 'opt-radio', 42 'type' => 'radio', 43 'title' => esc_html__( 'Radio Button', 'your-textdomain-here' ), 44 'subtitle' => esc_html__( 'Basic Radio Button field.', 'your-textdomain-here' ), 45 'options' => array( 46 '1' => esc_html__( 'Option 1', 'your-textdomain-here' ), 47 '2' => esc_html__( 'Option 2', 'your-textdomain-here' ), 48 '3' => esc_html__( 'Option 3', 'your-textdomain-here' ), 49 ), 50 'default' => '2', 51 ), 52 array( 53 'id' => 'opt-media', 54 'type' => 'media', 55 'url' => true, 56 'title' => esc_html__( 'Media w/ URL', 'your-textdomain-here' ), 57 'compiler' => 'true', 58 'desc' => esc_html__( 'Basic media uploader with disabled URL input field.', 'your-textdomain-here' ), 59 'subtitle' => esc_html__( 'Upload any media using the WordPress native uploader', 'your-textdomain-here' ), 60 'default' => array( 'url' => 'http://s.wordpress.org/style/images/codeispoetry.png' ), 61 ), 62 array( 63 'id' => 'gallery', 64 'type' => 'gallery', 65 'title' => esc_html__( 'Add/Edit Gallery', 'your-textdomain-here' ), 66 'subtitle' => esc_html__( 'Create a new Gallery by selecting existing or uploading new images using the WordPress native uploader', 'your-textdomain-here' ), 67 'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ), 68 ), 69 array( 70 'id' => 'opt-slider', 71 'type' => 'slider', 72 'title' => esc_html__( 'JQuery UI Slider Example 2 w/ Steps (5)', 'your-textdomain-here' ), 73 'desc' => esc_html__( 'JQuery UI slider description. Min: 0, max: 300, step: 5, default value: 75', 'your-textdomain-here' ), 74 'default' => '0', 75 'min' => '0', 76 'step' => '5', 77 'max' => '300', 78 ), 79 array( 80 'id' => 'opt-spinner', 81 'type' => 'spinner', 82 'title' => esc_html__( 'JQuery UI Spinner Example 1', 'your-textdomain-here' ), 83 'desc' => esc_html__( 'JQuery UI spinner description. Min:20, max: 100, step:20, default value: 40', 'your-textdomain-here' ), 84 'default' => '40', 85 'min' => '20', 86 'step' => '20', 87 'max' => '100', 88 ), 89 90 array( 91 'id' => 'switch-on', 92 'type' => 'switch', 93 'title' => esc_html__( 'Switch On', 'your-textdomain-here' ), 94 'subtitle' => esc_html__( 'Look, it\'s on!', 'your-textdomain-here' ), 95 'default' => 1, 96 ), 97 ), 98 ), 99 100 array( 101 'title' => esc_html__( 'Text Fields', 'your-textdomain-here' ), 102 'desc' => esc_html__( 'Redux Framework was created with the developer in mind. It allows for any theme developer to have an advanced theme panel with most of the features a developer would need. For more information check out the Github repo at:', 'your-textdomain-here' ) . ' <a href="https://github.com/ReduxFramework/Redux-Framework">https://github.com/ReduxFramework/Redux-Framework</a>', 103 'icon' => 'el-icon-cog', 104 'id' => 'opt-text-fields', 105 'subsection' => true, 106 'fields' => array( 107 array( 108 'title' => esc_html__( 'Text Field', 'your-textdomain-here' ), 109 'id' => 'opt-text', 110 'type' => 'text', 111 ), 112 array( 113 'title' => esc_html__( 'Textarea Field', 'your-textdomain-here' ), 114 'id' => 'opt-textarea', 115 'type' => 'textarea', 116 ), 117 ), 118 ), 119 120 array( 121 'title' => esc_html__( 'Color Field', 'your-textdomain-here' ), 122 'desc' => esc_html__( 'Redux Framework was created with the developer in mind. It allows for any theme developer to have an advanced theme panel with most of the features a developer would need. For more information check out the Github repo at:', 'your-textdomain-here' ) . ' <a href="https://github.com/ReduxFramework/Redux-Framework">https://github.com/ReduxFramework/Redux-Framework</a>', 123 'icon' => 'el-icon-pencil', 124 'id' => 'color-section', 125 'fields' => array( 126 array( 127 'id' => 'opt-color', 128 'type' => 'color', 129 'title' => __( 'Color Field', 'your-textdomain-here' ), 130 'default' => '#333333', 131 'required' => array( 'opt-layout', '=', 'on' ), 132 ), 133 ), 134 ), 135 array( 136 'title' => esc_html__( 'Layout', 'your-textdomain-here' ), 137 'desc' => esc_html__( 'Redux Framework was created with the developer in mind. It allows for any theme developer to have an advanced theme panel with most of the features a developer would need. For more information check out the Github repo at:', 'your-textdomain-here' ) . ' <a href="https://github.com/ReduxFramework/Redux-Framework">https://github.com/ReduxFramework/Redux-Framework</a>', 138 'icon' => 'el-icon-pencil', 139 'id' => 'home-layout', 140 'fields' => array( 141 array( 142 'id' => 'homepage_blocks', 143 'type' => 'sorter', 144 'title' => 'Homepage Layout Manager', 145 'desc' => 'Organize how you want the layout to appear on the homepage', 146 'compiler' => 'true', 147 'required' => array( 'layout', '=', '1' ), 148 'options' => array( 149 'enabled' => array( 150 'placebo' => 'placebo', 151 'highlights' => 'Highlights', 152 'slider' => 'Slider', 153 'staticpage' => 'Static Page', 154 'services' => 'Services', 155 ), 156 'disabled' => array( 157 'placebo' => 'placebo', 158 ), 159 ), 160 ), 161 array( 162 'id' => 'slides', 163 'type' => 'slides', 164 'title' => esc_html__( 'Slides Options', 'your-textdomain-here' ), 165 'subtitle' => esc_html__( 'Unlimited slides with drag and drop sortings.', 'your-textdomain-here' ), 166 'desc' => esc_html__( 'This field will store all slides values into a multidimensional array to use into a foreach loop.', 'your-textdomain-here' ), 167 ), 168 ), 169 ), 170 ), 171 ) 172 ); 173 174 175 Redux_Metaboxes::set_box( 176 $opt_name, 177 array( 178 'id' => 'opt-metaboxes-2', 179 'post_types' => array( 'page', 'post' ), 180 'position' => 'side', // normal, advanced, side. 181 'priority' => 'high', // high, core, default, low. 182 'sections' => array( 183 array( 184 'icon_class' => 'icon-large', 185 'icon' => 'el-icon-home', 186 'fields' => array( 187 array( 188 'title' => esc_html__( 'Cross Box Required', 'your-textdomain-here' ), 189 'desc' => esc_html__( 'Required arguments work across metaboxes! Click on Color Field under Metabox Options then adjust this field to see the fields within show or hide.', 'your-textdomain-here' ), 190 'id' => 'opt-layout', 191 'type' => 'radio', 192 'options' => array( 193 'on' => esc_html__( 'On', 'your-textdomain-here' ), 194 'off' => esc_html__( 'Off', 'your-textdomain-here' ), 195 ), 196 'default' => 'on', 197 ), 198 ), 199 ), 200 ), 201 ) 202 ); 203 204 Redux_Metaboxes::set_box( 205 $opt_name, 206 array( 207 'id' => 'opt-metaboxes-3', 208 'post_types' => array( 'page', 'post' ), 209 'position' => 'side', // normal, advanced, side. 210 'priority' => 'high', // high, core, default, low. 211 'sections' => array( 212 array( 213 'icon_class' => 'icon-large', 214 'icon' => 'el-icon-home', 215 'fields' => array( 216 array( 217 'id' => 'sidebar', 218 'title' => esc_html__( 'Sidebar', 'your-textdomain-here' ), 219 'desc' => esc_html__( 'Please select the sidebar you would like to display on this page. Note: You must first create the sidebar under Appearance > Widgets.', 'your-textdomain-here' ), 220 'type' => 'select', 221 'data' => 'sidebars', 222 'default' => 'None', 223 ), 224 ), 225 ), 226 ), 227 ) 228 );