| 1 |
<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly. |
| 2 |
|
| 3 |
// |
| 4 |
// Set a unique slug-like ID |
| 5 |
// |
| 6 |
$prefix = '_prefix_my_options'; |
| 7 |
|
| 8 |
// |
| 9 |
// Create options |
| 10 |
// |
| 11 |
CSF::createOptions( $prefix, array( |
| 12 |
'menu_title' => 'CSF Demo', |
| 13 |
'menu_slug' => 'csf-demo', |
| 14 |
) ); |
| 15 |
|
| 16 |
// |
| 17 |
// Create a section |
| 18 |
// |
| 19 |
CSF::createSection( $prefix, array( |
| 20 |
'title' => 'Overview', |
| 21 |
'icon' => 'fas fa-rocket', |
| 22 |
'fields' => array( |
| 23 |
|
| 24 |
// |
| 25 |
// A text field |
| 26 |
// |
| 27 |
array( |
| 28 |
'id' => 'opt-text', |
| 29 |
'type' => 'text', |
| 30 |
'title' => 'Text', |
| 31 |
), |
| 32 |
|
| 33 |
array( |
| 34 |
'id' => 'opt-textarea', |
| 35 |
'type' => 'textarea', |
| 36 |
'title' => 'Textarea', |
| 37 |
'help' => 'The help text of the field.', |
| 38 |
), |
| 39 |
|
| 40 |
array( |
| 41 |
'id' => 'opt-upload', |
| 42 |
'type' => 'upload', |
| 43 |
'title' => 'Upload', |
| 44 |
), |
| 45 |
|
| 46 |
array( |
| 47 |
'id' => 'opt-switcher', |
| 48 |
'type' => 'switcher', |
| 49 |
'title' => 'Switcher', |
| 50 |
'label' => 'The label text of the switcher.', |
| 51 |
), |
| 52 |
|
| 53 |
array( |
| 54 |
'id' => 'opt-color', |
| 55 |
'type' => 'color', |
| 56 |
'title' => 'Color', |
| 57 |
'default' => '#3498db', |
| 58 |
), |
| 59 |
|
| 60 |
array( |
| 61 |
'id' => 'opt-checkbox', |
| 62 |
'type' => 'checkbox', |
| 63 |
'title' => 'Checkbox', |
| 64 |
'label' => 'The label text of the checkbox.', |
| 65 |
), |
| 66 |
|
| 67 |
array( |
| 68 |
'id' => 'opt-radio', |
| 69 |
'type' => 'radio', |
| 70 |
'title' => 'Radio', |
| 71 |
'options' => array( |
| 72 |
'yes' => 'Yes, Please.', |
| 73 |
'no' => 'No, Thank you.', |
| 74 |
), |
| 75 |
'default' => 'yes', |
| 76 |
), |
| 77 |
|
| 78 |
array( |
| 79 |
'id' => 'opt-select', |
| 80 |
'type' => 'select', |
| 81 |
'title' => 'Select', |
| 82 |
'placeholder' => 'Select an option', |
| 83 |
'options' => array( |
| 84 |
'opt-1' => 'Option 1', |
| 85 |
'opt-2' => 'Option 2', |
| 86 |
'opt-3' => 'Option 3', |
| 87 |
), |
| 88 |
), |
| 89 |
|
| 90 |
array( |
| 91 |
'id' => 'opt-image-select', |
| 92 |
'type' => 'image_select', |
| 93 |
'title' => 'Image Select', |
| 94 |
'options' => array( |
| 95 |
'opt-1' => 'http://codestarframework.com/assets/images/placeholder/100x80-2ecc71.gif', |
| 96 |
'opt-2' => 'http://codestarframework.com/assets/images/placeholder/100x80-e74c3c.gif', |
| 97 |
'opt-3' => 'http://codestarframework.com/assets/images/placeholder/100x80-ffbc00.gif', |
| 98 |
'opt-4' => 'http://codestarframework.com/assets/images/placeholder/100x80-3498db.gif', |
| 99 |
'opt-5' => 'http://codestarframework.com/assets/images/placeholder/100x80-555555.gif', |
| 100 |
), |
| 101 |
'default' => 'opt-1', |
| 102 |
), |
| 103 |
|
| 104 |
array( |
| 105 |
'id' => 'opt-background', |
| 106 |
'type' => 'background', |
| 107 |
'title' => 'Background', |
| 108 |
), |
| 109 |
|
| 110 |
array( |
| 111 |
'type' => 'notice', |
| 112 |
'style' => 'success', |
| 113 |
'content' => 'A <strong>notice</strong> field with <strong>success</strong> style.', |
| 114 |
), |
| 115 |
|
| 116 |
array( |
| 117 |
'id' => 'opt-icon', |
| 118 |
'type' => 'icon', |
| 119 |
'title' => 'Icon', |
| 120 |
), |
| 121 |
|
| 122 |
array( |
| 123 |
'id' => 'opt-alt-text', |
| 124 |
'type' => 'text', |
| 125 |
'title' => 'Text', |
| 126 |
), |
| 127 |
|
| 128 |
array( |
| 129 |
'id' => 'opt-alt-textarea', |
| 130 |
'type' => 'textarea', |
| 131 |
'title' => 'Textarea', |
| 132 |
'subtitle' => 'A textarea with shortcoder.', |
| 133 |
'shortcoder' => 'csf_demo_shortcodes', |
| 134 |
), |
| 135 |
|
| 136 |
) |
| 137 |
) ); |
| 138 |
|
| 139 |
// |
| 140 |
// Basic Fields |
| 141 |
// |
| 142 |
CSF::createSection( $prefix, array( |
| 143 |
'id' => 'basic_fields', |
| 144 |
'title' => 'Basic Fields', |
| 145 |
'icon' => 'fas fa-plus-circle', |
| 146 |
) ); |
| 147 |
|
| 148 |
// |
| 149 |
// Field: text |
| 150 |
// |
| 151 |
CSF::createSection( $prefix, array( |
| 152 |
'parent' => 'basic_fields', |
| 153 |
'title' => 'Text', |
| 154 |
'icon' => 'far fa-square', |
| 155 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=text" target="_blank">Field: text</a>', |
| 156 |
'fields' => array( |
| 157 |
|
| 158 |
array( |
| 159 |
'id' => 'opt-text-1', |
| 160 |
'type' => 'text', |
| 161 |
'title' => 'Text', |
| 162 |
), |
| 163 |
|
| 164 |
array( |
| 165 |
'id' => 'opt-text-2', |
| 166 |
'type' => 'text', |
| 167 |
'title' => 'Text with default', |
| 168 |
'default' => 'This is default value bla bla bla', |
| 169 |
), |
| 170 |
|
| 171 |
array( |
| 172 |
'id' => 'opt-text-3', |
| 173 |
'type' => 'text', |
| 174 |
'title' => 'Text field ingenuity', |
| 175 |
'subtitle' => 'The field of subtitle text.', |
| 176 |
'help' => 'The field of help text.', |
| 177 |
'before' => '<p>The field of before text.</p>', |
| 178 |
'after' => '<p>The field of after text.</p>', |
| 179 |
), |
| 180 |
|
| 181 |
array( |
| 182 |
'id' => 'opt-text-4', |
| 183 |
'type' => 'text', |
| 184 |
'title' => 'Text with placeholder', |
| 185 |
'placeholder' => 'Typed something...' |
| 186 |
), |
| 187 |
|
| 188 |
array( |
| 189 |
'id' => 'opt-text-5', |
| 190 |
'type' => 'text', |
| 191 |
'title' => 'Text readonly', |
| 192 |
'attributes' => array( |
| 193 |
'readonly' => 'readonly' |
| 194 |
), |
| 195 |
'default' => 'readonly text field, can not be changed' |
| 196 |
), |
| 197 |
|
| 198 |
array( |
| 199 |
'id' => 'opt-text-6', |
| 200 |
'type' => 'text', |
| 201 |
'title' => 'Text with maxlength (5)', |
| 202 |
'attributes' => array( |
| 203 |
'maxlength' => '5' |
| 204 |
), |
| 205 |
'default' => 'abc', |
| 206 |
), |
| 207 |
|
| 208 |
array( |
| 209 |
'id' => 'opt-text-7', |
| 210 |
'type' => 'text', |
| 211 |
'title' => 'Text usign custom styles', |
| 212 |
'attributes' => array( |
| 213 |
'style' => 'width: 100%; height: 40px; border-color: #93C054;' |
| 214 |
), |
| 215 |
), |
| 216 |
|
| 217 |
array( |
| 218 |
'id' => 'opt-text-8', |
| 219 |
'type' => 'text', |
| 220 |
'after' => '<p>It shows full width if there is no field of title.</p>', |
| 221 |
), |
| 222 |
|
| 223 |
) |
| 224 |
) ); |
| 225 |
|
| 226 |
// |
| 227 |
// Field: textarea |
| 228 |
// |
| 229 |
CSF::createSection( $prefix, array( |
| 230 |
'parent' => 'basic_fields', |
| 231 |
'title' => 'Textarea', |
| 232 |
'icon' => 'far fa-square', |
| 233 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=textarea" target="_blank">Field: textrea</a>', |
| 234 |
'fields' => array( |
| 235 |
|
| 236 |
array( |
| 237 |
'id' => 'opt-textarea-1', |
| 238 |
'type' => 'textarea', |
| 239 |
'title' => 'Textarea', |
| 240 |
), |
| 241 |
|
| 242 |
array( |
| 243 |
'id' => 'opt-textarea-2', |
| 244 |
'type' => 'textarea', |
| 245 |
'title' => 'Textarea wtih default', |
| 246 |
'default' => 'This is default value bla bla bla', |
| 247 |
), |
| 248 |
|
| 249 |
array( |
| 250 |
'id' => 'opt-textarea-3', |
| 251 |
'type' => 'textarea', |
| 252 |
'title' => 'Text with placeholder', |
| 253 |
'placeholder' => 'Typed something...' |
| 254 |
), |
| 255 |
|
| 256 |
array( |
| 257 |
'id' => 'opt-textarea-4', |
| 258 |
'type' => 'textarea', |
| 259 |
'title' => 'Textarea with shortcoder', |
| 260 |
'shortcoder' => 'csf_demo_shortcodes', |
| 261 |
), |
| 262 |
|
| 263 |
array( |
| 264 |
'id' => 'opt-textarea-5', |
| 265 |
'type' => 'textarea', |
| 266 |
'title' => 'Textarea field ingenuity', |
| 267 |
'subtitle' => 'The field of subtitle text.', |
| 268 |
'help' => 'The field of help text.', |
| 269 |
'before' => '<p>The field of before text.</p>', |
| 270 |
'after' => '<p>The field of after text.</p>', |
| 271 |
), |
| 272 |
|
| 273 |
array( |
| 274 |
'id' => 'opt-textarea-6', |
| 275 |
'type' => 'textarea', |
| 276 |
'after' => '<p>It shows full width if there is no field of title.</p>', |
| 277 |
), |
| 278 |
|
| 279 |
) |
| 280 |
) ); |
| 281 |
|
| 282 |
// |
| 283 |
// Field: select |
| 284 |
// |
| 285 |
CSF::createSection( $prefix, array( |
| 286 |
'parent' => 'basic_fields', |
| 287 |
'title' => 'Select', |
| 288 |
'icon' => 'fas fa-list', |
| 289 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=select" target="_blank">Field: select</a>', |
| 290 |
'fields' => array( |
| 291 |
|
| 292 |
array( |
| 293 |
'id' => 'opt-select-1', |
| 294 |
'type' => 'select', |
| 295 |
'title' => 'Select', |
| 296 |
'placeholder' => 'Select an option', |
| 297 |
'options' => array( |
| 298 |
'opt-1' => 'Option 1', |
| 299 |
'opt-2' => 'Option 2', |
| 300 |
'opt-3' => 'Option 3', |
| 301 |
), |
| 302 |
), |
| 303 |
|
| 304 |
array( |
| 305 |
'id' => 'opt-select-2', |
| 306 |
'type' => 'select', |
| 307 |
'title' => 'Select with default', |
| 308 |
'placeholder' => 'Select an option', |
| 309 |
'options' => array( |
| 310 |
'opt-1' => 'Option 1', |
| 311 |
'opt-2' => 'Option 2', |
| 312 |
'opt-3' => 'Option 3', |
| 313 |
), |
| 314 |
'default' => 'opt-2' |
| 315 |
), |
| 316 |
|
| 317 |
array( |
| 318 |
'id' => 'opt-select-3', |
| 319 |
'type' => 'select', |
| 320 |
'title' => 'Select with group related options', |
| 321 |
'placeholder' => 'Select an option', |
| 322 |
'options' => array( |
| 323 |
'Group 1' => array( |
| 324 |
'opt-1' => 'Option 1', |
| 325 |
'opt-2' => 'Option 2', |
| 326 |
'opt-3' => 'Option 3', |
| 327 |
), |
| 328 |
'Group 2' => array( |
| 329 |
'opt-4' => 'Option 4', |
| 330 |
'opt-5' => 'Option 5', |
| 331 |
'opt-6' => 'Option 6', |
| 332 |
), |
| 333 |
'Group 3' => array( |
| 334 |
'opt-7' => 'Option 7', |
| 335 |
'opt-8' => 'Option 8', |
| 336 |
'opt-9' => 'Option 9', |
| 337 |
), |
| 338 |
), |
| 339 |
), |
| 340 |
|
| 341 |
array( |
| 342 |
'id' => 'opt-select-4', |
| 343 |
'type' => 'select', |
| 344 |
'title' => 'Select with multiple choice', |
| 345 |
'multiple' => true, |
| 346 |
'attributes' => array( |
| 347 |
'style' => 'min-width: 200px;' |
| 348 |
), |
| 349 |
'options' => array( |
| 350 |
'opt-1' => 'Option 1', |
| 351 |
'opt-2' => 'Option 2', |
| 352 |
'opt-3' => 'Option 3', |
| 353 |
'opt-4' => 'Option 4', |
| 354 |
'opt-5' => 'Option 5', |
| 355 |
'opt-6' => 'Option 6', |
| 356 |
), |
| 357 |
'default' => array( 'opt-2', 'opt-3' ), |
| 358 |
), |
| 359 |
|
| 360 |
array( |
| 361 |
'type' => 'notice', |
| 362 |
'style' => 'info', |
| 363 |
'content' => 'Select with <strong>chosen</strong> style.', |
| 364 |
), |
| 365 |
|
| 366 |
array( |
| 367 |
'id' => 'opt-select-5', |
| 368 |
'type' => 'select', |
| 369 |
'title' => 'Select with Chosen', |
| 370 |
'chosen' => true, |
| 371 |
'placeholder' => 'Select an option', |
| 372 |
'options' => array( |
| 373 |
'opt-1' => 'Option 1', |
| 374 |
'opt-2' => 'Option 2', |
| 375 |
'opt-3' => 'Option 3', |
| 376 |
'opt-4' => 'Option 4', |
| 377 |
'opt-5' => 'Option 5', |
| 378 |
'opt-6' => 'Option 6', |
| 379 |
), |
| 380 |
), |
| 381 |
|
| 382 |
array( |
| 383 |
'id' => 'opt-select-6', |
| 384 |
'type' => 'select', |
| 385 |
'title' => 'Select with multiple Chosen', |
| 386 |
'chosen' => true, |
| 387 |
'multiple' => true, |
| 388 |
'placeholder' => 'Select an option', |
| 389 |
'options' => array( |
| 390 |
'opt-1' => 'Option 1', |
| 391 |
'opt-2' => 'Option 2', |
| 392 |
'opt-3' => 'Option 3', |
| 393 |
'opt-4' => 'Option 4', |
| 394 |
'opt-5' => 'Option 5', |
| 395 |
'opt-6' => 'Option 6', |
| 396 |
), |
| 397 |
), |
| 398 |
|
| 399 |
array( |
| 400 |
'id' => 'opt-select-7', |
| 401 |
'type' => 'select', |
| 402 |
'title' => 'Select with multiple Chosen and Sortable', |
| 403 |
'chosen' => true, |
| 404 |
'multiple' => true, |
| 405 |
'sortable' => true, |
| 406 |
'placeholder' => 'Select an option', |
| 407 |
'options' => array( |
| 408 |
'opt-1' => 'Option 1', |
| 409 |
'opt-2' => 'Option 2', |
| 410 |
'opt-3' => 'Option 3', |
| 411 |
'opt-4' => 'Option 4', |
| 412 |
'opt-5' => 'Option 5', |
| 413 |
'opt-6' => 'Option 6', |
| 414 |
), |
| 415 |
'default' => array( 'opt-1', 'opt-2', 'opt-3' ) |
| 416 |
), |
| 417 |
|
| 418 |
array( |
| 419 |
'id' => 'opt-select-8', |
| 420 |
'type' => 'select', |
| 421 |
'title' => 'Select with multiple AJAX search Pages', |
| 422 |
'chosen' => true, |
| 423 |
'multiple' => true, |
| 424 |
'sortable' => true, |
| 425 |
'ajax' => true, |
| 426 |
'options' => 'pages', |
| 427 |
'placeholder' => 'Select pages', |
| 428 |
), |
| 429 |
|
| 430 |
array( |
| 431 |
'id' => 'opt-select-9', |
| 432 |
'type' => 'select', |
| 433 |
'title' => 'Select with multiple AJAX search Posts', |
| 434 |
'chosen' => true, |
| 435 |
'multiple' => true, |
| 436 |
'sortable' => true, |
| 437 |
'ajax' => true, |
| 438 |
'options' => 'posts', |
| 439 |
'placeholder' => 'Select posts', |
| 440 |
), |
| 441 |
|
| 442 |
array( |
| 443 |
'id' => 'opt-select-10', |
| 444 |
'type' => 'select', |
| 445 |
'title' => 'Select with AJAX search Category', |
| 446 |
'chosen' => true, |
| 447 |
'ajax' => true, |
| 448 |
'options' => 'category', |
| 449 |
'placeholder' => 'Select a category', |
| 450 |
), |
| 451 |
|
| 452 |
array( |
| 453 |
'type' => 'notice', |
| 454 |
'style' => 'info', |
| 455 |
'content' => 'Select with <strong>predefined wp query</strong> options.', |
| 456 |
), |
| 457 |
|
| 458 |
array( |
| 459 |
'id' => 'opt-select-11', |
| 460 |
'type' => 'select', |
| 461 |
'title' => 'Select with pages', |
| 462 |
'placeholder' => 'Select a page', |
| 463 |
'options' => 'pages', |
| 464 |
), |
| 465 |
|
| 466 |
array( |
| 467 |
'id' => 'opt-select-12', |
| 468 |
'type' => 'select', |
| 469 |
'title' => 'Select with posts', |
| 470 |
'placeholder' => 'Select a post', |
| 471 |
'options' => 'posts', |
| 472 |
), |
| 473 |
|
| 474 |
array( |
| 475 |
'id' => 'opt-select-13', |
| 476 |
'type' => 'select', |
| 477 |
'title' => 'Select with categories', |
| 478 |
'placeholder' => 'Select a category', |
| 479 |
'options' => 'categories', |
| 480 |
), |
| 481 |
|
| 482 |
array( |
| 483 |
'id' => 'opt-select-14', |
| 484 |
'type' => 'select', |
| 485 |
'title' => 'Select with menus', |
| 486 |
'placeholder' => 'Select a menu', |
| 487 |
'options' => 'menus', |
| 488 |
), |
| 489 |
|
| 490 |
array( |
| 491 |
'id' => 'opt-select-15', |
| 492 |
'type' => 'select', |
| 493 |
'title' => 'Select with locations', |
| 494 |
'placeholder' => 'Select a location', |
| 495 |
'options' => 'locations', |
| 496 |
), |
| 497 |
|
| 498 |
array( |
| 499 |
'id' => 'opt-select-16', |
| 500 |
'type' => 'select', |
| 501 |
'title' => 'Select with sidebars', |
| 502 |
'placeholder' => 'Select a sidebar', |
| 503 |
'options' => 'sidebars', |
| 504 |
), |
| 505 |
|
| 506 |
array( |
| 507 |
'id' => 'opt-select-17', |
| 508 |
'type' => 'select', |
| 509 |
'title' => 'Select with wp roles', |
| 510 |
'placeholder' => 'Select a role', |
| 511 |
'options' => 'roles', |
| 512 |
), |
| 513 |
|
| 514 |
array( |
| 515 |
'id' => 'opt-select-18', |
| 516 |
'type' => 'select', |
| 517 |
'title' => 'Select with users', |
| 518 |
'placeholder' => 'Select a user', |
| 519 |
'options' => 'users', |
| 520 |
), |
| 521 |
|
| 522 |
array( |
| 523 |
'id' => 'opt-select-19', |
| 524 |
'type' => 'select', |
| 525 |
'title' => 'Select with post type', |
| 526 |
'placeholder' => 'Select a post type', |
| 527 |
'options' => 'post_types', |
| 528 |
), |
| 529 |
|
| 530 |
array( |
| 531 |
'id' => 'opt-select-20', |
| 532 |
'type' => 'select', |
| 533 |
'title' => 'Select with CPT (custom post type) posts', |
| 534 |
'placeholder' => 'Select a post', |
| 535 |
'options' => 'posts', |
| 536 |
'query_args' => array( |
| 537 |
'post_type' => 'your_post_type_name', |
| 538 |
), |
| 539 |
), |
| 540 |
|
| 541 |
array( |
| 542 |
'id' => 'opt-select-21', |
| 543 |
'type' => 'select', |
| 544 |
'title' => 'Select with CPT (custom post type) categories', |
| 545 |
'placeholder' => 'Select a category', |
| 546 |
'options' => 'categories', |
| 547 |
'query_args' => array( |
| 548 |
'taxonomy' => 'your_taxonomy_name', |
| 549 |
), |
| 550 |
), |
| 551 |
|
| 552 |
) |
| 553 |
) ); |
| 554 |
|
| 555 |
// |
| 556 |
// Field: checkbox |
| 557 |
// |
| 558 |
CSF::createSection( $prefix, array( |
| 559 |
'parent' => 'basic_fields', |
| 560 |
'title' => 'Checkbox', |
| 561 |
'icon' => 'fas fa-check-square', |
| 562 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=checkbox" target="_blank">Field: checkbox</a>', |
| 563 |
'fields' => array( |
| 564 |
|
| 565 |
array( |
| 566 |
'id' => 'opt-checkbox-1', |
| 567 |
'type' => 'checkbox', |
| 568 |
'title' => 'Checkbox', |
| 569 |
'label' => 'The label text of the checkbox.', |
| 570 |
), |
| 571 |
|
| 572 |
array( |
| 573 |
'id' => 'opt-checkbox-2', |
| 574 |
'type' => 'checkbox', |
| 575 |
'title' => 'Checkbox with default', |
| 576 |
'label' => 'The label text of the checkbox.', |
| 577 |
'default' => true, |
| 578 |
), |
| 579 |
|
| 580 |
array( |
| 581 |
'id' => 'opt-checkbox-3', |
| 582 |
'type' => 'checkbox', |
| 583 |
'title' => 'Checkbox with multiple choice', |
| 584 |
'options' => array( |
| 585 |
'opt-1' => 'Option 1', |
| 586 |
'opt-2' => 'Option 2', |
| 587 |
'opt-3' => 'Option 3', |
| 588 |
), |
| 589 |
), |
| 590 |
|
| 591 |
array( |
| 592 |
'id' => 'opt-checkbox-4', |
| 593 |
'type' => 'checkbox', |
| 594 |
'title' => 'Checkbox inline with multiple choice', |
| 595 |
'inline' => true, |
| 596 |
'options' => array( |
| 597 |
'opt-1' => 'Option 1', |
| 598 |
'opt-2' => 'Option 2', |
| 599 |
'opt-3' => 'Option 3', |
| 600 |
), |
| 601 |
), |
| 602 |
|
| 603 |
array( |
| 604 |
'id' => 'opt-checkbox-5', |
| 605 |
'type' => 'checkbox', |
| 606 |
'title' => 'Checkbox multiple choice with default', |
| 607 |
'options' => array( |
| 608 |
'opt-1' => 'Option 1', |
| 609 |
'opt-2' => 'Option 2', |
| 610 |
'opt-3' => 'Option 3', |
| 611 |
), |
| 612 |
'default' => array( 'opt-1', 'opt-2' ) |
| 613 |
), |
| 614 |
|
| 615 |
array( |
| 616 |
'id' => 'opt-checkbox-6', |
| 617 |
'type' => 'checkbox', |
| 618 |
'title' => 'Checkbox with group related options', |
| 619 |
'options' => array( |
| 620 |
'Group 1' => array( |
| 621 |
'opt-1' => 'Option 1', |
| 622 |
'opt-2' => 'Option 2', |
| 623 |
'opt-3' => 'Option 3', |
| 624 |
), |
| 625 |
'Group 2' => array( |
| 626 |
'opt-4' => 'Option 4', |
| 627 |
'opt-5' => 'Option 5', |
| 628 |
'opt-6' => 'Option 6', |
| 629 |
), |
| 630 |
), |
| 631 |
), |
| 632 |
|
| 633 |
array( |
| 634 |
'id' => 'opt-checkbox-7', |
| 635 |
'type' => 'checkbox', |
| 636 |
'title' => 'Checkbox testing on many items', |
| 637 |
'options' => array( |
| 638 |
'opt-1' => 'Option 1', |
| 639 |
'opt-2' => 'Option 2', |
| 640 |
'opt-3' => 'Option 3', |
| 641 |
'opt-4' => 'Option 4', |
| 642 |
'opt-5' => 'Option 5', |
| 643 |
'opt-6' => 'Option 6', |
| 644 |
'opt-7' => 'Option 7', |
| 645 |
'opt-8' => 'Option 8', |
| 646 |
'opt-9' => 'Option 9', |
| 647 |
'opt-10' => 'Option 10', |
| 648 |
'opt-11' => 'Option 11', |
| 649 |
'opt-12' => 'Option 12', |
| 650 |
'opt-13' => 'Option 13', |
| 651 |
'opt-14' => 'Option 14', |
| 652 |
'opt-15' => 'Option 15', |
| 653 |
), |
| 654 |
'desc' => 'Vertical scroll showing automatically after add many items', |
| 655 |
), |
| 656 |
|
| 657 |
array( |
| 658 |
'type' => 'notice', |
| 659 |
'style' => 'info', |
| 660 |
'content' => 'Checkbox with <strong>predefined wp query</strong> options similar like <strong>select</strong> field. (see select field for all options models.)', |
| 661 |
), |
| 662 |
|
| 663 |
array( |
| 664 |
'id' => 'opt-checkbox-8', |
| 665 |
'type' => 'checkbox', |
| 666 |
'title' => 'Checkbox with categories', |
| 667 |
'options' => 'categories', |
| 668 |
), |
| 669 |
|
| 670 |
) |
| 671 |
) ); |
| 672 |
|
| 673 |
// |
| 674 |
// Field: radio |
| 675 |
// |
| 676 |
CSF::createSection( $prefix, array( |
| 677 |
'parent' => 'basic_fields', |
| 678 |
'title' => 'Radio', |
| 679 |
'icon' => 'fas fa-dot-circle', |
| 680 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=radio" target="_blank">Field: radio</a>', |
| 681 |
'fields' => array( |
| 682 |
|
| 683 |
array( |
| 684 |
'id' => 'opt-radio-1', |
| 685 |
'type' => 'radio', |
| 686 |
'title' => 'Radio', |
| 687 |
'options' => array( |
| 688 |
'opt-1' => 'Option 1', |
| 689 |
'opt-2' => 'Option 2', |
| 690 |
'opt-3' => 'Option 3', |
| 691 |
), |
| 692 |
), |
| 693 |
|
| 694 |
array( |
| 695 |
'id' => 'opt-radio-2', |
| 696 |
'type' => 'radio', |
| 697 |
'title' => 'Radio with default', |
| 698 |
'options' => array( |
| 699 |
'opt-1' => 'Option 1', |
| 700 |
'opt-2' => 'Option 2', |
| 701 |
'opt-3' => 'Option 3', |
| 702 |
), |
| 703 |
'default' => 'opt-2', |
| 704 |
), |
| 705 |
|
| 706 |
array( |
| 707 |
'id' => 'opt-radio-3', |
| 708 |
'type' => 'radio', |
| 709 |
'title' => 'Radio with inline style', |
| 710 |
'inline' => true, |
| 711 |
'options' => array( |
| 712 |
'opt-1' => 'Option 1', |
| 713 |
'opt-2' => 'Option 2', |
| 714 |
'opt-3' => 'Option 3', |
| 715 |
), |
| 716 |
), |
| 717 |
|
| 718 |
array( |
| 719 |
'id' => 'opt-radio-4', |
| 720 |
'type' => 'radio', |
| 721 |
'title' => 'Radio with group related options', |
| 722 |
'options' => array( |
| 723 |
'Group 1' => array( |
| 724 |
'opt-1' => 'Option 1', |
| 725 |
'opt-2' => 'Option 2', |
| 726 |
'opt-3' => 'Option 3', |
| 727 |
), |
| 728 |
'Group 2' => array( |
| 729 |
'opt-4' => 'Option 4', |
| 730 |
'opt-5' => 'Option 5', |
| 731 |
'opt-6' => 'Option 6', |
| 732 |
), |
| 733 |
), |
| 734 |
), |
| 735 |
|
| 736 |
array( |
| 737 |
'id' => 'opt-radio-5', |
| 738 |
'type' => 'radio', |
| 739 |
'title' => 'Radio testing on many items', |
| 740 |
'options' => array( |
| 741 |
'opt-1' => 'Option 1', |
| 742 |
'opt-2' => 'Option 2', |
| 743 |
'opt-3' => 'Option 3', |
| 744 |
'opt-4' => 'Option 4', |
| 745 |
'opt-5' => 'Option 5', |
| 746 |
'opt-6' => 'Option 6', |
| 747 |
'opt-7' => 'Option 7', |
| 748 |
'opt-8' => 'Option 8', |
| 749 |
'opt-9' => 'Option 9', |
| 750 |
'opt-10' => 'Option 10', |
| 751 |
'opt-11' => 'Option 11', |
| 752 |
'opt-12' => 'Option 12', |
| 753 |
'opt-13' => 'Option 13', |
| 754 |
'opt-14' => 'Option 14', |
| 755 |
'opt-15' => 'Option 15', |
| 756 |
), |
| 757 |
'desc' => 'Vertical scroll showing automatically after add many items' |
| 758 |
), |
| 759 |
|
| 760 |
array( |
| 761 |
'type' => 'notice', |
| 762 |
'style' => 'info', |
| 763 |
'content' => 'Radio with <strong>predefined wp query</strong> options similar like <strong>select</strong> field. (see select field for all options models.)', |
| 764 |
), |
| 765 |
|
| 766 |
array( |
| 767 |
'id' => 'opt-radio-6', |
| 768 |
'type' => 'radio', |
| 769 |
'title' => 'Radio with categories', |
| 770 |
'options' => 'categories', |
| 771 |
), |
| 772 |
|
| 773 |
) |
| 774 |
) ); |
| 775 |
|
| 776 |
// |
| 777 |
// Repeater Fields |
| 778 |
// |
| 779 |
CSF::createSection( $prefix, array( |
| 780 |
'id' => 'repeater_fields', |
| 781 |
'title' => 'Repeater Fields', |
| 782 |
'icon' => 'far fa-clone', |
| 783 |
) ); |
| 784 |
|
| 785 |
// |
| 786 |
// Field: repeater |
| 787 |
// |
| 788 |
CSF::createSection( $prefix, array( |
| 789 |
'parent' => 'repeater_fields', |
| 790 |
'title' => 'Repeater', |
| 791 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=repeater" target="_blank">Field: repeater</a>', |
| 792 |
'fields' => array( |
| 793 |
|
| 794 |
array( |
| 795 |
'id' => 'opt-repeater-1', |
| 796 |
'type' => 'repeater', |
| 797 |
'title' => 'Repeater', |
| 798 |
'fields' => array( |
| 799 |
array( |
| 800 |
'id' => 'opt-text', |
| 801 |
'type' => 'text', |
| 802 |
'title' => 'Text' |
| 803 |
), |
| 804 |
), |
| 805 |
), |
| 806 |
|
| 807 |
array( |
| 808 |
'id' => 'opt-repeater-2', |
| 809 |
'type' => 'repeater', |
| 810 |
'title' => 'Repeater with default', |
| 811 |
'fields' => array( |
| 812 |
array( |
| 813 |
'id' => 'opt-text', |
| 814 |
'type' => 'text', |
| 815 |
'title' => 'Text', |
| 816 |
), |
| 817 |
), |
| 818 |
'default' => array( |
| 819 |
array( |
| 820 |
'opt-text' => 'Text default 1', |
| 821 |
), |
| 822 |
array( |
| 823 |
'opt-text' => 'Text default 2', |
| 824 |
), |
| 825 |
), |
| 826 |
), |
| 827 |
|
| 828 |
array( |
| 829 |
'id' => 'opt-repeater-3', |
| 830 |
'type' => 'repeater', |
| 831 |
'title' => 'Repeater with multiple fields', |
| 832 |
'fields' => array( |
| 833 |
array( |
| 834 |
'id' => 'opt-switcher', |
| 835 |
'type' => 'switcher', |
| 836 |
'title' => 'Switcher', |
| 837 |
), |
| 838 |
array( |
| 839 |
'id' => 'opt-color', |
| 840 |
'type' => 'color', |
| 841 |
'title' => 'Color', |
| 842 |
), |
| 843 |
array( |
| 844 |
'id' => 'opt-text', |
| 845 |
'type' => 'text', |
| 846 |
'title' => 'Text', |
| 847 |
), |
| 848 |
), |
| 849 |
'default' => array( |
| 850 |
array( |
| 851 |
'opt-switcher' => false, |
| 852 |
'opt-color' => '#3498db', |
| 853 |
'opt-text' => 'Text default 1', |
| 854 |
), |
| 855 |
), |
| 856 |
), |
| 857 |
|
| 858 |
array( |
| 859 |
'id' => 'opt-repeater-4', |
| 860 |
'type' => 'repeater', |
| 861 |
'title' => 'Repeater with limited (min - max items)', |
| 862 |
'subtitle' => 'The maximum/minimum number of items the user can add. (In this example min:1, max:3)', |
| 863 |
'button_title' => 'Add Text', |
| 864 |
'min' => 1, |
| 865 |
'max' => 3, |
| 866 |
'fields' => array( |
| 867 |
array( |
| 868 |
'id' => 'opt-text', |
| 869 |
'type' => 'text', |
| 870 |
'title' => 'Text', |
| 871 |
), |
| 872 |
), |
| 873 |
'default' => array( |
| 874 |
array( |
| 875 |
'opt-text' => 'Text default 1', |
| 876 |
), |
| 877 |
array( |
| 878 |
'opt-text' => 'Text default 2', |
| 879 |
), |
| 880 |
), |
| 881 |
), |
| 882 |
|
| 883 |
array( |
| 884 |
'id' => 'opt-repeater-6', |
| 885 |
'type' => 'repeater', |
| 886 |
'title' => 'Repeater nested repeater', |
| 887 |
'subtitle' => 'Can be added unlimited nested repeater', |
| 888 |
'fields' => array( |
| 889 |
array( |
| 890 |
'id' => 'opt-text', |
| 891 |
'type' => 'text', |
| 892 |
'title' => 'Text', |
| 893 |
), |
| 894 |
array( |
| 895 |
'id' => 'opt-repeater-6-nested-1', |
| 896 |
'type' => 'repeater', |
| 897 |
'title' => 'Repeater', |
| 898 |
'fields' => array( |
| 899 |
array( |
| 900 |
'id' => 'opt-text', |
| 901 |
'type' => 'text', |
| 902 |
'title' => 'Text' |
| 903 |
), |
| 904 |
), |
| 905 |
), |
| 906 |
), |
| 907 |
'default' => array( |
| 908 |
array( |
| 909 |
'opt-text' => 'Text default 1', |
| 910 |
'opt-repeater-6-nested-1' => array( |
| 911 |
array( |
| 912 |
'opt-text' => 'Text default 1', |
| 913 |
), |
| 914 |
array( |
| 915 |
'opt-text' => 'Text default 2', |
| 916 |
), |
| 917 |
), |
| 918 |
), |
| 919 |
), |
| 920 |
), |
| 921 |
|
| 922 |
) |
| 923 |
) ); |
| 924 |
|
| 925 |
// |
| 926 |
// Field: group |
| 927 |
// |
| 928 |
CSF::createSection( $prefix, array( |
| 929 |
'parent' => 'repeater_fields', |
| 930 |
'title' => 'Group', |
| 931 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=group" target="_blank">Field: group</a>', |
| 932 |
'fields' => array( |
| 933 |
|
| 934 |
array( |
| 935 |
'id' => 'opt-group-1', |
| 936 |
'type' => 'group', |
| 937 |
'title' => 'Group', |
| 938 |
'fields' => array( |
| 939 |
array( |
| 940 |
'id' => 'opt-text', |
| 941 |
'type' => 'text', |
| 942 |
'title' => 'Text', |
| 943 |
), |
| 944 |
array( |
| 945 |
'id' => 'opt-switcher', |
| 946 |
'type' => 'switcher', |
| 947 |
'title' => 'Switcher', |
| 948 |
), |
| 949 |
array( |
| 950 |
'id' => 'opt-textarea', |
| 951 |
'type' => 'textarea', |
| 952 |
'title' => 'Textarea', |
| 953 |
), |
| 954 |
) |
| 955 |
), |
| 956 |
|
| 957 |
array( |
| 958 |
'id' => 'opt-group-2', |
| 959 |
'type' => 'group', |
| 960 |
'title' => 'Group with default', |
| 961 |
'fields' => array( |
| 962 |
array( |
| 963 |
'id' => 'opt-text', |
| 964 |
'type' => 'text', |
| 965 |
'title' => 'Text', |
| 966 |
), |
| 967 |
array( |
| 968 |
'id' => 'opt-switcher', |
| 969 |
'type' => 'switcher', |
| 970 |
'title' => 'Switcher', |
| 971 |
), |
| 972 |
array( |
| 973 |
'id' => 'opt-textarea', |
| 974 |
'type' => 'textarea', |
| 975 |
'title' => 'Textarea', |
| 976 |
), |
| 977 |
), |
| 978 |
'default' => array( |
| 979 |
array( |
| 980 |
'opt-text' => 'Some text 1', |
| 981 |
'opt-switcher' => true, |
| 982 |
'opt-textarea' => 'Some textarea content 1', |
| 983 |
), |
| 984 |
array( |
| 985 |
'opt-text' => 'Some text 2', |
| 986 |
'opt-switcher' => false, |
| 987 |
'opt-textarea' => 'Some textarea content 2', |
| 988 |
), |
| 989 |
) |
| 990 |
), |
| 991 |
|
| 992 |
array( |
| 993 |
'id' => 'opt-group-3', |
| 994 |
'type' => 'group', |
| 995 |
'title' => 'Group with limited (min - max items)', |
| 996 |
'subtitle' => 'The maximum/minimum number of items the user can add. (In this example min:1, max:3)', |
| 997 |
'min' => 1, |
| 998 |
'max' => 3, |
| 999 |
'fields' => array( |
| 1000 |
array( |
| 1001 |
'id' => 'opt-text', |
| 1002 |
'type' => 'text', |
| 1003 |
'title' => 'Text', |
| 1004 |
), |
| 1005 |
array( |
| 1006 |
'id' => 'opt-textarea', |
| 1007 |
'type' => 'textarea', |
| 1008 |
'title' => 'Textarea', |
| 1009 |
), |
| 1010 |
), |
| 1011 |
'default' => array( |
| 1012 |
array( |
| 1013 |
'opt-text' => 'Limited text 1', |
| 1014 |
'opt-textarea' => 'Limited textarea content 1', |
| 1015 |
), |
| 1016 |
array( |
| 1017 |
'opt-text' => 'Limited text 2', |
| 1018 |
'opt-textarea' => 'Limited textarea content 2', |
| 1019 |
), |
| 1020 |
) |
| 1021 |
), |
| 1022 |
|
| 1023 |
array( |
| 1024 |
'id' => 'opt-group-4', |
| 1025 |
'type' => 'group', |
| 1026 |
'title' => 'Group with WP Editor', |
| 1027 |
'subtitle' => 'WP Editor integrated for Ajax Call.', |
| 1028 |
'fields' => array( |
| 1029 |
array( |
| 1030 |
'id' => 'opt-text', |
| 1031 |
'type' => 'text', |
| 1032 |
'title' => 'Text', |
| 1033 |
), |
| 1034 |
array( |
| 1035 |
'id' => 'opt-editor', |
| 1036 |
'type' => 'wp_editor', |
| 1037 |
'title' => 'WP Editor', |
| 1038 |
), |
| 1039 |
), |
| 1040 |
'default' => array( |
| 1041 |
array( |
| 1042 |
'opt-text' => 'WP Editor 1', |
| 1043 |
'opt-editor' => 'Editor content 1', |
| 1044 |
), |
| 1045 |
array( |
| 1046 |
'opt-text' => 'WP Editor 2', |
| 1047 |
'opt-editor' => 'Editor content 2', |
| 1048 |
), |
| 1049 |
) |
| 1050 |
), |
| 1051 |
|
| 1052 |
array( |
| 1053 |
'id' => 'opt-group-5', |
| 1054 |
'type' => 'group', |
| 1055 |
'title' => 'Group nested', |
| 1056 |
'subtitle' => 'Can be added unlimited nested groups', |
| 1057 |
'fields' => array( |
| 1058 |
array( |
| 1059 |
'id' => 'opt-text', |
| 1060 |
'type' => 'text', |
| 1061 |
'title' => 'Text', |
| 1062 |
), |
| 1063 |
array( |
| 1064 |
'id' => 'opt-group-5-sublevel-1', |
| 1065 |
'type' => 'group', |
| 1066 |
'title' => 'Group Nested', |
| 1067 |
'fields' => array( |
| 1068 |
array( |
| 1069 |
'id' => 'opt-text', |
| 1070 |
'type' => 'text', |
| 1071 |
'title' => 'Text', |
| 1072 |
), |
| 1073 |
array( |
| 1074 |
'id' => 'opt-group-5-sublevel-2', |
| 1075 |
'type' => 'group', |
| 1076 |
'title' => 'Group Nested', |
| 1077 |
'fields' => array( |
| 1078 |
array( |
| 1079 |
'id' => 'opt-text', |
| 1080 |
'type' => 'text', |
| 1081 |
'title' => 'Text', |
| 1082 |
), |
| 1083 |
array( |
| 1084 |
'id' => 'opt-switcher', |
| 1085 |
'type' => 'switcher', |
| 1086 |
'title' => 'Switcher', |
| 1087 |
), |
| 1088 |
array( |
| 1089 |
'id' => 'opt-textarea', |
| 1090 |
'type' => 'textarea', |
| 1091 |
'title' => 'Textarea', |
| 1092 |
), |
| 1093 |
) |
| 1094 |
), |
| 1095 |
array( |
| 1096 |
'id' => 'opt-switcher', |
| 1097 |
'type' => 'switcher', |
| 1098 |
'title' => 'Switcher', |
| 1099 |
), |
| 1100 |
array( |
| 1101 |
'id' => 'opt-textarea', |
| 1102 |
'type' => 'textarea', |
| 1103 |
'title' => 'Textarea', |
| 1104 |
), |
| 1105 |
) |
| 1106 |
), |
| 1107 |
array( |
| 1108 |
'id' => 'opt-switcher', |
| 1109 |
'type' => 'switcher', |
| 1110 |
'title' => 'Switcher', |
| 1111 |
), |
| 1112 |
array( |
| 1113 |
'id' => 'opt-textarea', |
| 1114 |
'type' => 'textarea', |
| 1115 |
'title' => 'Textarea', |
| 1116 |
), |
| 1117 |
), |
| 1118 |
'default' => array( |
| 1119 |
|
| 1120 |
// top level defaults |
| 1121 |
array( |
| 1122 |
'opt-text' => 'Top Level 1', |
| 1123 |
|
| 1124 |
// sub level 1 defaults |
| 1125 |
'opt-group-5-sublevel-1' => array( |
| 1126 |
array( |
| 1127 |
'opt-text' => 'Sub Level 1', |
| 1128 |
|
| 1129 |
// sub level 2 defaults |
| 1130 |
'opt-group-5-sublevel-2' => array( |
| 1131 |
array( |
| 1132 |
'opt-text' => 'Sub Sub Level 1', |
| 1133 |
), |
| 1134 |
array( |
| 1135 |
'opt-text' => 'Sub Sub Level 2', |
| 1136 |
) |
| 1137 |
), |
| 1138 |
), |
| 1139 |
array( |
| 1140 |
'opt-text' => 'Sub Level 2', |
| 1141 |
) |
| 1142 |
), |
| 1143 |
), |
| 1144 |
|
| 1145 |
// top level defaults |
| 1146 |
array( |
| 1147 |
'opt-text' => 'Top Level 2', |
| 1148 |
), |
| 1149 |
) |
| 1150 |
), |
| 1151 |
|
| 1152 |
array( |
| 1153 |
'id' => 'opt-group-6', |
| 1154 |
'type' => 'group', |
| 1155 |
'title' => 'Group with Repeater Field', |
| 1156 |
'fields' => array( |
| 1157 |
array( |
| 1158 |
'id' => 'opt-text', |
| 1159 |
'type' => 'text', |
| 1160 |
'title' => 'Text', |
| 1161 |
), |
| 1162 |
array( |
| 1163 |
'id' => 'opt-group-6-repeater', |
| 1164 |
'type' => 'repeater', |
| 1165 |
'title' => 'Repeater', |
| 1166 |
'fields' => array( |
| 1167 |
array( |
| 1168 |
'id' => 'opt-text', |
| 1169 |
'type' => 'text', |
| 1170 |
'title' => 'Text' |
| 1171 |
), |
| 1172 |
), |
| 1173 |
), |
| 1174 |
array( |
| 1175 |
'id' => 'opt-switcher', |
| 1176 |
'type' => 'switcher', |
| 1177 |
'title' => 'Switcher', |
| 1178 |
), |
| 1179 |
array( |
| 1180 |
'id' => 'opt-textarea', |
| 1181 |
'type' => 'textarea', |
| 1182 |
'title' => 'Textarea', |
| 1183 |
), |
| 1184 |
), |
| 1185 |
'default' => array( |
| 1186 |
array( |
| 1187 |
'opt-text' => 'Some text 1', |
| 1188 |
'opt-group-6-repeater' => array( |
| 1189 |
array( |
| 1190 |
'opt-text' => 'Some text 1', |
| 1191 |
), |
| 1192 |
array( |
| 1193 |
'opt-text' => 'Some text 2', |
| 1194 |
), |
| 1195 |
) |
| 1196 |
), |
| 1197 |
) |
| 1198 |
), |
| 1199 |
|
| 1200 |
array( |
| 1201 |
'id' => 'opt-group-7', |
| 1202 |
'type' => 'group', |
| 1203 |
'title' => 'Group with static prefix of title', |
| 1204 |
'subtitle' => 'accordion_title_prefix => "Static Prefix:"', |
| 1205 |
'accordion_title_prefix' => 'Static Prefix:', |
| 1206 |
'fields' => array( |
| 1207 |
array( |
| 1208 |
'id' => 'opt-text', |
| 1209 |
'type' => 'text', |
| 1210 |
'title' => 'Text', |
| 1211 |
), |
| 1212 |
array( |
| 1213 |
'id' => 'opt-switcher', |
| 1214 |
'type' => 'switcher', |
| 1215 |
'title' => 'Switcher', |
| 1216 |
), |
| 1217 |
array( |
| 1218 |
'id' => 'opt-textarea', |
| 1219 |
'type' => 'textarea', |
| 1220 |
'title' => 'Textarea', |
| 1221 |
), |
| 1222 |
), |
| 1223 |
'default' => array( |
| 1224 |
array( |
| 1225 |
'opt-text' => 'Some text 1', |
| 1226 |
'opt-switcher' => true, |
| 1227 |
'opt-textarea' => 'Some textarea content 1', |
| 1228 |
), |
| 1229 |
array( |
| 1230 |
'opt-text' => 'Some text 2', |
| 1231 |
'opt-switcher' => false, |
| 1232 |
'opt-textarea' => 'Some textarea content 2', |
| 1233 |
), |
| 1234 |
) |
| 1235 |
), |
| 1236 |
|
| 1237 |
array( |
| 1238 |
'id' => 'opt-group-8', |
| 1239 |
'type' => 'group', |
| 1240 |
'title' => 'Group with title numbers', |
| 1241 |
'subtitle' => 'accordion_title_number => true', |
| 1242 |
'accordion_title_number' => true, |
| 1243 |
'fields' => array( |
| 1244 |
array( |
| 1245 |
'id' => 'opt-text', |
| 1246 |
'type' => 'text', |
| 1247 |
'title' => 'Text', |
| 1248 |
), |
| 1249 |
array( |
| 1250 |
'id' => 'opt-switcher', |
| 1251 |
'type' => 'switcher', |
| 1252 |
'title' => 'Switcher', |
| 1253 |
), |
| 1254 |
array( |
| 1255 |
'id' => 'opt-textarea', |
| 1256 |
'type' => 'textarea', |
| 1257 |
'title' => 'Textarea', |
| 1258 |
), |
| 1259 |
), |
| 1260 |
'default' => array( |
| 1261 |
array( |
| 1262 |
'opt-text' => 'Some text 1', |
| 1263 |
'opt-switcher' => true, |
| 1264 |
'opt-textarea' => 'Some textarea content 1', |
| 1265 |
), |
| 1266 |
array( |
| 1267 |
'opt-text' => 'Some text 2', |
| 1268 |
'opt-switcher' => false, |
| 1269 |
'opt-textarea' => 'Some textarea content 2', |
| 1270 |
), |
| 1271 |
) |
| 1272 |
), |
| 1273 |
|
| 1274 |
array( |
| 1275 |
'id' => 'opt-group-9', |
| 1276 |
'type' => 'group', |
| 1277 |
'title' => 'Group with custom titles', |
| 1278 |
'subtitle' => 'accordion_title_by => array( \'opt-name\', \'opt-surname\' )', |
| 1279 |
'accordion_title_by' => array( 'opt-name', 'opt-surname' ), |
| 1280 |
'fields' => array( |
| 1281 |
array( |
| 1282 |
'id' => 'opt-name', |
| 1283 |
'type' => 'text', |
| 1284 |
'title' => 'Name', |
| 1285 |
), |
| 1286 |
array( |
| 1287 |
'id' => 'opt-surname', |
| 1288 |
'type' => 'text', |
| 1289 |
'title' => 'Surname', |
| 1290 |
), |
| 1291 |
array( |
| 1292 |
'id' => 'opt-textarea', |
| 1293 |
'type' => 'textarea', |
| 1294 |
'title' => 'Textarea', |
| 1295 |
), |
| 1296 |
), |
| 1297 |
'default' => array( |
| 1298 |
array( |
| 1299 |
'opt-name' => 'John', |
| 1300 |
'opt-surname' => 'Doe', |
| 1301 |
'opt-textarea' => 'Textarea 1', |
| 1302 |
), |
| 1303 |
array( |
| 1304 |
'opt-name' => 'Jane', |
| 1305 |
'opt-surname' => 'Doe', |
| 1306 |
'opt-textarea' => 'Textarea 1', |
| 1307 |
), |
| 1308 |
) |
| 1309 |
), |
| 1310 |
|
| 1311 |
array( |
| 1312 |
'id' => 'opt-group-10', |
| 1313 |
'type' => 'group', |
| 1314 |
'title' => 'Group with custom titles and prefix', |
| 1315 |
'subtitle' => 'accordion_title_by => array( \'opt-text\', \'opt-textarea\' )<br />accordion_title_by_prefix => \' | \'', |
| 1316 |
'accordion_title_by' => array( 'opt-text', 'opt-textarea' ), |
| 1317 |
'accordion_title_by_prefix' => ' | ', |
| 1318 |
'fields' => array( |
| 1319 |
array( |
| 1320 |
'id' => 'opt-text', |
| 1321 |
'type' => 'text', |
| 1322 |
'title' => 'Title', |
| 1323 |
), |
| 1324 |
array( |
| 1325 |
'id' => 'opt-textarea', |
| 1326 |
'type' => 'textarea', |
| 1327 |
'title' => 'Textarea', |
| 1328 |
), |
| 1329 |
), |
| 1330 |
'default' => array( |
| 1331 |
array( |
| 1332 |
'opt-text' => 'Text 1', |
| 1333 |
'opt-textarea' => 'Textarea 1', |
| 1334 |
), |
| 1335 |
array( |
| 1336 |
'opt-text' => 'Text 2', |
| 1337 |
'opt-textarea' => 'Textarea 1', |
| 1338 |
), |
| 1339 |
) |
| 1340 |
), |
| 1341 |
|
| 1342 |
) |
| 1343 |
) ); |
| 1344 |
|
| 1345 |
// |
| 1346 |
// Combine Fields |
| 1347 |
// |
| 1348 |
CSF::createSection( $prefix, array( |
| 1349 |
'id' => 'combine_fields', |
| 1350 |
'title' => 'Combine Fields', |
| 1351 |
'icon' => 'fas fa-bars', |
| 1352 |
) ); |
| 1353 |
|
| 1354 |
// |
| 1355 |
// Field: accordion |
| 1356 |
// |
| 1357 |
CSF::createSection( $prefix, array( |
| 1358 |
'parent' => 'combine_fields', |
| 1359 |
'title' => 'Accordion', |
| 1360 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=accordion" target="_blank">Field: accordion</a>', |
| 1361 |
'fields' => array( |
| 1362 |
|
| 1363 |
array( |
| 1364 |
'id' => 'opt-accordion-1', |
| 1365 |
'type' => 'accordion', |
| 1366 |
'title' => 'Accordion', |
| 1367 |
'accordions' => array( |
| 1368 |
|
| 1369 |
array( |
| 1370 |
'title' => 'Accordion 1', |
| 1371 |
'fields' => array( |
| 1372 |
array( |
| 1373 |
'id' => 'opt-text-1', |
| 1374 |
'type' => 'text', |
| 1375 |
'title' => 'Text', |
| 1376 |
), |
| 1377 |
array( |
| 1378 |
'id' => 'opt-switcher-1', |
| 1379 |
'type' => 'switcher', |
| 1380 |
'title' => 'Switcher', |
| 1381 |
), |
| 1382 |
array( |
| 1383 |
'id' => 'opt-textarea-1', |
| 1384 |
'type' => 'textarea', |
| 1385 |
'title' => 'Textarea', |
| 1386 |
), |
| 1387 |
) |
| 1388 |
), |
| 1389 |
|
| 1390 |
array( |
| 1391 |
'title' => 'Accordion 2', |
| 1392 |
'fields' => array( |
| 1393 |
array( |
| 1394 |
'id' => 'opt-text-2', |
| 1395 |
'type' => 'text', |
| 1396 |
'title' => 'Text', |
| 1397 |
), |
| 1398 |
array( |
| 1399 |
'id' => 'opt-color-1', |
| 1400 |
'type' => 'color', |
| 1401 |
'title' => 'Color', |
| 1402 |
), |
| 1403 |
) |
| 1404 |
), |
| 1405 |
|
| 1406 |
) |
| 1407 |
), |
| 1408 |
|
| 1409 |
array( |
| 1410 |
'id' => 'opt-accordion-2', |
| 1411 |
'type' => 'accordion', |
| 1412 |
'title' => 'Accordion with default', |
| 1413 |
'accordions' => array( |
| 1414 |
|
| 1415 |
array( |
| 1416 |
'title' => 'Fields 1', |
| 1417 |
'fields' => array( |
| 1418 |
array( |
| 1419 |
'id' => 'opt-text-1', |
| 1420 |
'type' => 'text', |
| 1421 |
'title' => 'Text 1', |
| 1422 |
), |
| 1423 |
array( |
| 1424 |
'id' => 'opt-text-2', |
| 1425 |
'type' => 'text', |
| 1426 |
'title' => 'Text 2', |
| 1427 |
), |
| 1428 |
) |
| 1429 |
), |
| 1430 |
|
| 1431 |
array( |
| 1432 |
'title' => 'Fields 2', |
| 1433 |
'fields' => array( |
| 1434 |
array( |
| 1435 |
'id' => 'opt-color-1', |
| 1436 |
'type' => 'color', |
| 1437 |
'title' => 'Color 1', |
| 1438 |
), |
| 1439 |
array( |
| 1440 |
'id' => 'opt-color-2', |
| 1441 |
'type' => 'color', |
| 1442 |
'title' => 'Color 2', |
| 1443 |
), |
| 1444 |
) |
| 1445 |
), |
| 1446 |
|
| 1447 |
array( |
| 1448 |
'title' => 'Fields 3', |
| 1449 |
'fields' => array( |
| 1450 |
array( |
| 1451 |
'id' => 'opt-textarea-1', |
| 1452 |
'type' => 'textarea', |
| 1453 |
'title' => 'Textarea 3', |
| 1454 |
), |
| 1455 |
array( |
| 1456 |
'id' => 'opt-textarea-2', |
| 1457 |
'type' => 'textarea', |
| 1458 |
'title' => 'Textarea 4', |
| 1459 |
), |
| 1460 |
) |
| 1461 |
), |
| 1462 |
|
| 1463 |
), |
| 1464 |
'default' => array( |
| 1465 |
'opt-text-1' => 'This is text 1 default value', |
| 1466 |
'opt-text-2' => 'This is text 2 default value', |
| 1467 |
'opt-color-1' => '#1e73be', |
| 1468 |
'opt-color-2' => '#ffbc00', |
| 1469 |
'opt-textarea-1' => 'This is textarea 1 default value', |
| 1470 |
'opt-textarea-2' => 'This is textarea 2 default value', |
| 1471 |
) |
| 1472 |
), |
| 1473 |
|
| 1474 |
array( |
| 1475 |
'id' => 'accordion_3', |
| 1476 |
'type' => 'accordion', |
| 1477 |
'title' => 'Accordion with custom icons', |
| 1478 |
'accordions' => array( |
| 1479 |
|
| 1480 |
array( |
| 1481 |
'title' => 'Other 1', |
| 1482 |
'icon' => 'fas fa-check', |
| 1483 |
'fields' => array( |
| 1484 |
array( |
| 1485 |
'id' => 'opt-text-1', |
| 1486 |
'type' => 'text', |
| 1487 |
'title' => 'Text 1', |
| 1488 |
), |
| 1489 |
) |
| 1490 |
), |
| 1491 |
|
| 1492 |
array( |
| 1493 |
'title' => 'Other 2', |
| 1494 |
'icon' => 'fas fa-star', |
| 1495 |
'fields' => array( |
| 1496 |
array( |
| 1497 |
'id' => 'opt-text-2', |
| 1498 |
'type' => 'text', |
| 1499 |
'title' => 'Text 2', |
| 1500 |
), |
| 1501 |
) |
| 1502 |
), |
| 1503 |
|
| 1504 |
) |
| 1505 |
), |
| 1506 |
|
| 1507 |
) |
| 1508 |
) ); |
| 1509 |
|
| 1510 |
// |
| 1511 |
// Field: tabbed |
| 1512 |
// |
| 1513 |
CSF::createSection( $prefix, array( |
| 1514 |
'parent' => 'combine_fields', |
| 1515 |
'title' => 'Tabbed', |
| 1516 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=tabbed" target="_blank">Field: tabbed</a>', |
| 1517 |
'fields' => array( |
| 1518 |
|
| 1519 |
array( |
| 1520 |
'id' => 'opt-tabbed-1', |
| 1521 |
'type' => 'tabbed', |
| 1522 |
'title' => 'Tabbed', |
| 1523 |
'tabs' => array( |
| 1524 |
|
| 1525 |
array( |
| 1526 |
'title' => 'Tab 1', |
| 1527 |
'fields' => array( |
| 1528 |
array( |
| 1529 |
'id' => 'opt-text-1', |
| 1530 |
'type' => 'text', |
| 1531 |
'title' => 'Text 1', |
| 1532 |
), |
| 1533 |
array( |
| 1534 |
'id' => 'opt-textarea-1', |
| 1535 |
'type' => 'textarea', |
| 1536 |
'title' => 'Textarea 1', |
| 1537 |
), |
| 1538 |
), |
| 1539 |
), |
| 1540 |
|
| 1541 |
array( |
| 1542 |
'title' => 'Tab 2', |
| 1543 |
'fields' => array( |
| 1544 |
array( |
| 1545 |
'id' => 'opt-text-2', |
| 1546 |
'type' => 'text', |
| 1547 |
'title' => 'Text 2', |
| 1548 |
), |
| 1549 |
array( |
| 1550 |
'id' => 'opt-textarea-2', |
| 1551 |
'type' => 'textarea', |
| 1552 |
'title' => 'Textarea 2', |
| 1553 |
), |
| 1554 |
), |
| 1555 |
), |
| 1556 |
|
| 1557 |
), |
| 1558 |
), |
| 1559 |
|
| 1560 |
array( |
| 1561 |
'id' => 'opt-tabbed-2', |
| 1562 |
'type' => 'tabbed', |
| 1563 |
'title' => 'Tabbed with default and icons', |
| 1564 |
'tabs' => array( |
| 1565 |
array( |
| 1566 |
'title' => 'Fields 1', |
| 1567 |
'icon' => 'fas fa-check', |
| 1568 |
'fields' => array( |
| 1569 |
array( |
| 1570 |
'id' => 'opt-text-1', |
| 1571 |
'type' => 'text', |
| 1572 |
'title' => 'Text 1', |
| 1573 |
), |
| 1574 |
array( |
| 1575 |
'id' => 'opt-text-2', |
| 1576 |
'type' => 'text', |
| 1577 |
'title' => 'Text 2', |
| 1578 |
), |
| 1579 |
), |
| 1580 |
), |
| 1581 |
array( |
| 1582 |
'title' => 'Fields 2', |
| 1583 |
'icon' => 'fas fa-star', |
| 1584 |
'fields' => array( |
| 1585 |
array( |
| 1586 |
'id' => 'opt-color-1', |
| 1587 |
'type' => 'color', |
| 1588 |
'title' => 'Color 1', |
| 1589 |
), |
| 1590 |
array( |
| 1591 |
'id' => 'opt-color-2', |
| 1592 |
'type' => 'color', |
| 1593 |
'title' => 'Color 2', |
| 1594 |
), |
| 1595 |
), |
| 1596 |
), |
| 1597 |
array( |
| 1598 |
'title' => 'Fields 3', |
| 1599 |
'icon' => 'fas fa-cog', |
| 1600 |
'fields' => array( |
| 1601 |
array( |
| 1602 |
'id' => 'opt-textarea-1', |
| 1603 |
'type' => 'textarea', |
| 1604 |
'title' => 'Textarea 1', |
| 1605 |
), |
| 1606 |
array( |
| 1607 |
'id' => 'opt-textarea-2', |
| 1608 |
'type' => 'textarea', |
| 1609 |
'title' => 'Textarea 2', |
| 1610 |
), |
| 1611 |
), |
| 1612 |
), |
| 1613 |
), |
| 1614 |
'default' => array( |
| 1615 |
'opt-text-1' => 'This is text 1 default value', |
| 1616 |
'opt-text-2' => 'This is text 2 default value', |
| 1617 |
'opt-color-1' => '#1e73be', |
| 1618 |
'opt-color-2' => '#ffbc00', |
| 1619 |
'opt-textarea-1' => 'This is textarea 1 default value', |
| 1620 |
'opt-textarea-2' => 'This is textarea 2 default value', |
| 1621 |
) |
| 1622 |
), |
| 1623 |
|
| 1624 |
) |
| 1625 |
) ); |
| 1626 |
|
| 1627 |
// |
| 1628 |
// Field: fieldset |
| 1629 |
// |
| 1630 |
CSF::createSection( $prefix, array( |
| 1631 |
'parent' => 'combine_fields', |
| 1632 |
'title' => 'Fieldset', |
| 1633 |
'fields' => array( |
| 1634 |
|
| 1635 |
array( |
| 1636 |
'id' => 'opt-fieldset-1', |
| 1637 |
'type' => 'fieldset', |
| 1638 |
'title' => 'Fieldset', |
| 1639 |
'fields' => array( |
| 1640 |
array( |
| 1641 |
'id' => 'opt-color', |
| 1642 |
'type' => 'color', |
| 1643 |
'title' => 'Color', |
| 1644 |
), |
| 1645 |
array( |
| 1646 |
'id' => 'opt-text', |
| 1647 |
'type' => 'text', |
| 1648 |
'title' => 'Text', |
| 1649 |
), |
| 1650 |
array( |
| 1651 |
'id' => 'opt-textarea', |
| 1652 |
'type' => 'textarea', |
| 1653 |
'title' => 'Textarea', |
| 1654 |
), |
| 1655 |
), |
| 1656 |
), |
| 1657 |
|
| 1658 |
array( |
| 1659 |
'id' => 'opt-fieldset-2', |
| 1660 |
'type' => 'fieldset', |
| 1661 |
'title' => 'Fieldset with default', |
| 1662 |
'fields' => array( |
| 1663 |
array( |
| 1664 |
'type' => 'subheading', |
| 1665 |
'content' => 'Title of the fieldset', |
| 1666 |
), |
| 1667 |
array( |
| 1668 |
'id' => 'opt-color', |
| 1669 |
'type' => 'color', |
| 1670 |
'title' => 'Color', |
| 1671 |
), |
| 1672 |
array( |
| 1673 |
'id' => 'opt-text', |
| 1674 |
'type' => 'text', |
| 1675 |
'title' => 'Text', |
| 1676 |
), |
| 1677 |
array( |
| 1678 |
'id' => 'opt-textarea', |
| 1679 |
'type' => 'textarea', |
| 1680 |
'title' => 'Textarea', |
| 1681 |
), |
| 1682 |
), |
| 1683 |
'default' => array( |
| 1684 |
'opt-color' => '#1e73be', |
| 1685 |
'opt-text' => 'This is text default value', |
| 1686 |
'opt-textarea' => 'This is textarea default value', |
| 1687 |
) |
| 1688 |
), |
| 1689 |
|
| 1690 |
) |
| 1691 |
) ); |
| 1692 |
|
| 1693 |
// |
| 1694 |
// Media and Upload Fields |
| 1695 |
// |
| 1696 |
CSF::createSection( $prefix, array( |
| 1697 |
'id' => 'media_fields', |
| 1698 |
'title' => 'Media and Upload Fields', |
| 1699 |
'icon' => 'fas fa-upload', |
| 1700 |
) ); |
| 1701 |
|
| 1702 |
// |
| 1703 |
// Field: media |
| 1704 |
// |
| 1705 |
CSF::createSection( $prefix, array( |
| 1706 |
'parent' => 'media_fields', |
| 1707 |
'title' => 'Media', |
| 1708 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=media" target="_blank">Field: media</a>', |
| 1709 |
'fields' => array( |
| 1710 |
|
| 1711 |
array( |
| 1712 |
'id' => 'opt-media-1', |
| 1713 |
'type' => 'media', |
| 1714 |
'title' => 'Media', |
| 1715 |
), |
| 1716 |
|
| 1717 |
array( |
| 1718 |
'id' => 'opt-media-2', |
| 1719 |
'type' => 'media', |
| 1720 |
'title' => 'Media without preview', |
| 1721 |
'preview' => false, |
| 1722 |
), |
| 1723 |
|
| 1724 |
array( |
| 1725 |
'id' => 'opt-media-3', |
| 1726 |
'type' => 'media', |
| 1727 |
'title' => 'Media without url', |
| 1728 |
'url' => false, |
| 1729 |
), |
| 1730 |
|
| 1731 |
array( |
| 1732 |
'id' => 'opt-media-4', |
| 1733 |
'type' => 'media', |
| 1734 |
'title' => 'Media with only image type', |
| 1735 |
'library' => 'image', |
| 1736 |
), |
| 1737 |
|
| 1738 |
array( |
| 1739 |
'id' => 'opt-media-5', |
| 1740 |
'type' => 'media', |
| 1741 |
'title' => 'Media with only video type', |
| 1742 |
'library' => 'video', |
| 1743 |
), |
| 1744 |
|
| 1745 |
array( |
| 1746 |
'id' => 'opt-media-6', |
| 1747 |
'type' => 'media', |
| 1748 |
'title' => 'Media with only audio type', |
| 1749 |
'library' => 'audio', |
| 1750 |
), |
| 1751 |
|
| 1752 |
) |
| 1753 |
) ); |
| 1754 |
|
| 1755 |
// |
| 1756 |
// Field: upload |
| 1757 |
// |
| 1758 |
CSF::createSection( $prefix, array( |
| 1759 |
'parent' => 'media_fields', |
| 1760 |
'title' => 'Upload', |
| 1761 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=upload" target="_blank">Field: upload</a>', |
| 1762 |
'fields' => array( |
| 1763 |
|
| 1764 |
array( |
| 1765 |
'id' => 'opt-upload-1', |
| 1766 |
'type' => 'upload', |
| 1767 |
'title' => 'Upload', |
| 1768 |
), |
| 1769 |
|
| 1770 |
array( |
| 1771 |
'id' => 'opt-upload-2', |
| 1772 |
'type' => 'upload', |
| 1773 |
'title' => 'Upload with preview', |
| 1774 |
'preview' => true, |
| 1775 |
), |
| 1776 |
|
| 1777 |
array( |
| 1778 |
'id' => 'opt-upload-3', |
| 1779 |
'type' => 'upload', |
| 1780 |
'title' => 'Upload with placeholder', |
| 1781 |
'placeholder' => 'http://' |
| 1782 |
), |
| 1783 |
|
| 1784 |
array( |
| 1785 |
'id' => 'opt-upload-4', |
| 1786 |
'type' => 'upload', |
| 1787 |
'title' => 'Upload with only image type', |
| 1788 |
'library' => 'image', |
| 1789 |
'button_title' => 'Upload Image', |
| 1790 |
), |
| 1791 |
|
| 1792 |
array( |
| 1793 |
'id' => 'opt-upload-5', |
| 1794 |
'type' => 'upload', |
| 1795 |
'title' => 'Upload with only video type', |
| 1796 |
'library' => 'video', |
| 1797 |
'button_title' => 'Upload Video', |
| 1798 |
), |
| 1799 |
|
| 1800 |
array( |
| 1801 |
'id' => 'opt-upload-6', |
| 1802 |
'type' => 'upload', |
| 1803 |
'title' => 'Upload with only audio type', |
| 1804 |
'library' => 'audio', |
| 1805 |
'button_title' => 'Upload Audio', |
| 1806 |
), |
| 1807 |
|
| 1808 |
) |
| 1809 |
) ); |
| 1810 |
|
| 1811 |
// |
| 1812 |
// Field: gallery |
| 1813 |
// |
| 1814 |
CSF::createSection( $prefix, array( |
| 1815 |
'parent' => 'media_fields', |
| 1816 |
'title' => 'Gallery', |
| 1817 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=gallery" target="_blank">Field: gallery</a>', |
| 1818 |
'fields' => array( |
| 1819 |
|
| 1820 |
array( |
| 1821 |
'id' => 'opt-gallery-1', |
| 1822 |
'type' => 'gallery', |
| 1823 |
'title' => 'Gallery', |
| 1824 |
), |
| 1825 |
|
| 1826 |
array( |
| 1827 |
'id' => 'opt-gallery-2', |
| 1828 |
'type' => 'gallery', |
| 1829 |
'title' => 'Gallery with custom button names', |
| 1830 |
'add_title' => 'Add Image(s)', |
| 1831 |
'edit_title' => 'Edit Images', |
| 1832 |
'clear_title' => 'Remove Images', |
| 1833 |
), |
| 1834 |
|
| 1835 |
) |
| 1836 |
) ); |
| 1837 |
|
| 1838 |
// |
| 1839 |
// Editor Fields |
| 1840 |
// |
| 1841 |
CSF::createSection( $prefix, array( |
| 1842 |
'id' => 'editor_fields', |
| 1843 |
'title' => 'Editor Fields', |
| 1844 |
'icon' => 'fas fa-code', |
| 1845 |
) ); |
| 1846 |
|
| 1847 |
// |
| 1848 |
// Field: code_editor |
| 1849 |
// |
| 1850 |
CSF::createSection( $prefix, array( |
| 1851 |
'parent' => 'editor_fields', |
| 1852 |
'title' => 'Code Editor', |
| 1853 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=code-editor" target="_blank">Field: code_editor</a>', |
| 1854 |
'fields' => array( |
| 1855 |
|
| 1856 |
array( |
| 1857 |
'id' => 'opt-code-editor-1', |
| 1858 |
'type' => 'code_editor', |
| 1859 |
'title' => 'Code Editor', |
| 1860 |
'subtitle' => '<strong>Default Editor</strong> Using: theme: default and mode: htmlmixed', |
| 1861 |
), |
| 1862 |
|
| 1863 |
array( |
| 1864 |
'id' => 'code_editor_2', |
| 1865 |
'type' => 'code_editor', |
| 1866 |
'title' => 'Code Editor', |
| 1867 |
'subtitle' => '<strong>HTML Editor</strong> Using: theme: shadowfox and mode: htmlmixed', |
| 1868 |
'settings' => array( |
| 1869 |
'theme' => 'shadowfox', |
| 1870 |
'mode' => 'htmlmixed', |
| 1871 |
), |
| 1872 |
'default' =>'<div class="wrapper"> |
| 1873 |
<h1>Hello world</h1> |
| 1874 |
<p>Lorem <strong>ipsum</strong> dollar.</p> |
| 1875 |
</div>', |
| 1876 |
), |
| 1877 |
|
| 1878 |
array( |
| 1879 |
'id' => 'opt-code-editor-2', |
| 1880 |
'type' => 'code_editor', |
| 1881 |
'title' => 'Code Editor', |
| 1882 |
'subtitle' => '<strong>JS Editor</strong> Using: theme: dracula and mode: javascript', |
| 1883 |
'settings' => array( |
| 1884 |
'theme' => 'dracula', |
| 1885 |
'mode' => 'javascript', |
| 1886 |
), |
| 1887 |
'default' =>';(function( $, window, document, undefined ) { |
| 1888 |
"use strict"; |
| 1889 |
|
| 1890 |
$(document).ready( function() { |
| 1891 |
|
| 1892 |
// do stuff |
| 1893 |
|
| 1894 |
}); |
| 1895 |
|
| 1896 |
})( jQuery, window, document );', |
| 1897 |
), |
| 1898 |
|
| 1899 |
array( |
| 1900 |
'id' => 'opt-code-editor-3', |
| 1901 |
'type' => 'code_editor', |
| 1902 |
'desc' => '<strong>CSS Editor</strong> It shows full width if there is no field of title and using: theme: mbo and mode: css', |
| 1903 |
'settings' => array( |
| 1904 |
'theme' => 'mbo', |
| 1905 |
'mode' => 'css', |
| 1906 |
), |
| 1907 |
'default' =>'.wrapper { |
| 1908 |
font-family: "Open Sans"; |
| 1909 |
font-size: 13px; |
| 1910 |
width: 250px; |
| 1911 |
height: 100px; |
| 1912 |
color: #fff; |
| 1913 |
background-color: #555; |
| 1914 |
}', |
| 1915 |
), |
| 1916 |
|
| 1917 |
) |
| 1918 |
) ); |
| 1919 |
|
| 1920 |
// |
| 1921 |
// Field: wp_editor |
| 1922 |
// |
| 1923 |
CSF::createSection( $prefix, array( |
| 1924 |
'parent' => 'editor_fields', |
| 1925 |
'title' => 'WP Editor', |
| 1926 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=wp-editor" target="_blank">Field: wp_editor</a>', |
| 1927 |
'fields' => array( |
| 1928 |
|
| 1929 |
array( |
| 1930 |
'id' => 'opt-wp-editor-1', |
| 1931 |
'type' => 'wp_editor', |
| 1932 |
'title' => 'WP Editor', |
| 1933 |
), |
| 1934 |
|
| 1935 |
array( |
| 1936 |
'id' => 'opt-wp-editor-2', |
| 1937 |
'type' => 'wp_editor', |
| 1938 |
'title' => 'WP Editor with Custom Height and No Media Buttons', |
| 1939 |
'subtitle' => 'Settings:<br />height => 100px,<br />media_buttons => false', |
| 1940 |
'height' => '100px', |
| 1941 |
'media_buttons' => false, |
| 1942 |
), |
| 1943 |
|
| 1944 |
array( |
| 1945 |
'id' => 'opt-wp-editor-3', |
| 1946 |
'type' => 'wp_editor', |
| 1947 |
'title' => 'WP Editor without QuickTags and Media Buttons', |
| 1948 |
'subtitle' => 'Settings:<br />height => 100px,<br />media_buttons => false,<br />quicktags => false', |
| 1949 |
'height' => '100px', |
| 1950 |
'media_buttons' => false, |
| 1951 |
'quicktags' => false, |
| 1952 |
), |
| 1953 |
|
| 1954 |
array( |
| 1955 |
'id' => 'opt-wp-editor-4', |
| 1956 |
'type' => 'wp_editor', |
| 1957 |
'title' => 'WP Editor without Tinymce and Media Buttons', |
| 1958 |
'subtitle' => 'Settings:<br />height => 100px,<br />media_buttons => false,<br />tinymce => false', |
| 1959 |
'height' => '100px', |
| 1960 |
'media_buttons' => false, |
| 1961 |
'tinymce' => false, |
| 1962 |
), |
| 1963 |
|
| 1964 |
) |
| 1965 |
) ); |
| 1966 |
|
| 1967 |
// |
| 1968 |
// Color Fields |
| 1969 |
// |
| 1970 |
CSF::createSection( $prefix, array( |
| 1971 |
'id' => 'color_fields', |
| 1972 |
'title' => 'Color Fields', |
| 1973 |
'icon' => 'fas fa-tint', |
| 1974 |
) ); |
| 1975 |
|
| 1976 |
// |
| 1977 |
// Field: color |
| 1978 |
// |
| 1979 |
CSF::createSection( $prefix, array( |
| 1980 |
'parent' => 'color_fields', |
| 1981 |
'title' => 'Color', |
| 1982 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=color" target="_blank">Field: color</a>', |
| 1983 |
'fields' => array( |
| 1984 |
|
| 1985 |
array( |
| 1986 |
'id' => 'opt-color-1', |
| 1987 |
'type' => 'color', |
| 1988 |
'title' => 'Color', |
| 1989 |
), |
| 1990 |
|
| 1991 |
array( |
| 1992 |
'id' => 'opt-color-2', |
| 1993 |
'type' => 'color', |
| 1994 |
'title' => 'Color with default (hex)', |
| 1995 |
'default' => '#3498db', |
| 1996 |
), |
| 1997 |
|
| 1998 |
array( |
| 1999 |
'id' => 'opt-color-3', |
| 2000 |
'type' => 'color', |
| 2001 |
'title' => 'Color with default (rgba)', |
| 2002 |
'default' => 'rgba(255,255,0,0.25)', |
| 2003 |
), |
| 2004 |
|
| 2005 |
array( |
| 2006 |
'id' => 'opt-color-4', |
| 2007 |
'type' => 'color', |
| 2008 |
'title' => 'Color with default (transparent)', |
| 2009 |
'default' => 'transparent', |
| 2010 |
), |
| 2011 |
|
| 2012 |
) |
| 2013 |
) ); |
| 2014 |
|
| 2015 |
// |
| 2016 |
// Field: link_color |
| 2017 |
// |
| 2018 |
CSF::createSection( $prefix, array( |
| 2019 |
'parent' => 'color_fields', |
| 2020 |
'title' => 'Link Color', |
| 2021 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=link-color" target="_blank">Field: link_color</a>', |
| 2022 |
'fields' => array( |
| 2023 |
|
| 2024 |
array( |
| 2025 |
'id' => 'opt-link-color-1', |
| 2026 |
'type' => 'link_color', |
| 2027 |
'title' => 'Link Color', |
| 2028 |
), |
| 2029 |
|
| 2030 |
array( |
| 2031 |
'id' => 'opt-link-color-2', |
| 2032 |
'type' => 'link_color', |
| 2033 |
'title' => 'Link Color with default', |
| 2034 |
'default' => array( |
| 2035 |
'color' => '#1e73be', |
| 2036 |
'hover' => '#259ded', |
| 2037 |
), |
| 2038 |
), |
| 2039 |
|
| 2040 |
array( |
| 2041 |
'id' => 'opt-link-color-3', |
| 2042 |
'type' => 'link_color', |
| 2043 |
'title' => 'Link Color with more color options', |
| 2044 |
'color' => true, |
| 2045 |
'hover' => true, |
| 2046 |
'visited' => true, |
| 2047 |
'active' => true, |
| 2048 |
'focus' => true, |
| 2049 |
), |
| 2050 |
|
| 2051 |
) |
| 2052 |
) ); |
| 2053 |
|
| 2054 |
// |
| 2055 |
// Field: color_group |
| 2056 |
// |
| 2057 |
CSF::createSection( $prefix, array( |
| 2058 |
'parent' => 'color_fields', |
| 2059 |
'title' => 'Color Group', |
| 2060 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=color-group" target="_blank">Field: color_group</a>', |
| 2061 |
'fields' => array( |
| 2062 |
|
| 2063 |
array( |
| 2064 |
'id' => 'opt-color-group-1', |
| 2065 |
'type' => 'color_group', |
| 2066 |
'title' => 'Color Group', |
| 2067 |
'options' => array( |
| 2068 |
'color-1' => 'Color 1', |
| 2069 |
'color-2' => 'Color 2', |
| 2070 |
) |
| 2071 |
), |
| 2072 |
|
| 2073 |
array( |
| 2074 |
'id' => 'opt-color-group-2', |
| 2075 |
'type' => 'color_group', |
| 2076 |
'title' => 'Color Group', |
| 2077 |
'options' => array( |
| 2078 |
'color-1' => 'Color 1', |
| 2079 |
'color-2' => 'Color 2', |
| 2080 |
'color-3' => 'Color 3', |
| 2081 |
) |
| 2082 |
), |
| 2083 |
|
| 2084 |
array( |
| 2085 |
'id' => 'opt-color-group-3', |
| 2086 |
'type' => 'color_group', |
| 2087 |
'title' => 'Color Group with default', |
| 2088 |
'subtitle' => 'Can be add unlimited color options.', |
| 2089 |
'options' => array( |
| 2090 |
'color-1' => 'Color 1', |
| 2091 |
'color-2' => 'Color 2', |
| 2092 |
'color-3' => 'Color 3', |
| 2093 |
'color-4' => 'Color 4', |
| 2094 |
'color-5' => 'Color 5', |
| 2095 |
), |
| 2096 |
'default' => array( |
| 2097 |
'color-1' => '#000100', |
| 2098 |
'color-2' => '#002642', |
| 2099 |
'color-3' => '#ffce4b', |
| 2100 |
'color-4' => '#ff595e', |
| 2101 |
'color-5' => '#0052cc', |
| 2102 |
) |
| 2103 |
), |
| 2104 |
|
| 2105 |
) |
| 2106 |
) ); |
| 2107 |
|
| 2108 |
// |
| 2109 |
// Field: palette |
| 2110 |
// |
| 2111 |
CSF::createSection( $prefix, array( |
| 2112 |
'parent' => 'color_fields', |
| 2113 |
'title' => 'Color Palette', |
| 2114 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=palette" target="_blank">Field: palette</a>', |
| 2115 |
'fields' => array( |
| 2116 |
|
| 2117 |
array( |
| 2118 |
'id' => 'opt-palette-1', |
| 2119 |
'type' => 'palette', |
| 2120 |
'title' => 'Palette', |
| 2121 |
'subtitle' => 'Three set colors', |
| 2122 |
'options' => array( |
| 2123 |
'set-1' => array( '#f36e27', '#f3d430', '#ed1683' ), |
| 2124 |
'set-2' => array( '#4153ab', '#6e86c7', '#211f27' ), |
| 2125 |
'set-3' => array( '#162526', '#508486', '#C8C6CE' ), |
| 2126 |
'set-4' => array( '#ccab5e', '#fff55f', '#197c5d' ), |
| 2127 |
), |
| 2128 |
'default' => 'set-1', |
| 2129 |
), |
| 2130 |
|
| 2131 |
array( |
| 2132 |
'id' => 'opt-palette-2', |
| 2133 |
'type' => 'palette', |
| 2134 |
'title' => 'Palette', |
| 2135 |
'subtitle' => 'Four set colors', |
| 2136 |
'options' => array( |
| 2137 |
'set-1' => array( '#f04e36', '#f36e27', '#f3d430', '#ed1683' ), |
| 2138 |
'set-2' => array( '#f9ca06', '#b5b546', '#2f4d48', '#212b2f' ), |
| 2139 |
'set-3' => array( '#4153ab', '#6e86c7', '#211f27', '#d69762' ), |
| 2140 |
'set-4' => array( '#162526', '#508486', '#C8C6CE', '#B45F1A' ), |
| 2141 |
'set-5' => array( '#bbd5ff', '#ccab5e', '#fff55f', '#197c5d' ), |
| 2142 |
), |
| 2143 |
'default' => 'set-3', |
| 2144 |
), |
| 2145 |
|
| 2146 |
array( |
| 2147 |
'id' => 'opt-palette-3', |
| 2148 |
'type' => 'palette', |
| 2149 |
'title' => 'Palette', |
| 2150 |
'subtitle' => 'Five set colors', |
| 2151 |
'options' => array( |
| 2152 |
'set-1' => array( '#bbd5ff', '#ccab5e', '#fff55f', '#197c5d', '#bce2c4' ), |
| 2153 |
'set-2' => array( '#6d3264', '#edf7f6', '#fde8e9', '#006675', '#e49ab0' ), |
| 2154 |
'set-3' => array( '#000100', '#002642', '#ffce4b', '#ff595e', '#0052cc' ), |
| 2155 |
), |
| 2156 |
'default' => 'set-1', |
| 2157 |
), |
| 2158 |
|
| 2159 |
) |
| 2160 |
) ); |
| 2161 |
|
| 2162 |
// |
| 2163 |
// Design Fields |
| 2164 |
// |
| 2165 |
CSF::createSection( $prefix, array( |
| 2166 |
'id' => 'design_fields', |
| 2167 |
'title' => 'Design Fields', |
| 2168 |
'icon' => 'fas fa-adjust', |
| 2169 |
) ); |
| 2170 |
|
| 2171 |
// |
| 2172 |
// Field: background |
| 2173 |
// |
| 2174 |
CSF::createSection( $prefix, array( |
| 2175 |
'parent' => 'design_fields', |
| 2176 |
'title' => 'Background', |
| 2177 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=background" target="_blank">Field: background</a>', |
| 2178 |
'fields' => array( |
| 2179 |
|
| 2180 |
array( |
| 2181 |
'id' => 'opt-background-1', |
| 2182 |
'type' => 'background', |
| 2183 |
'title' => 'Background', |
| 2184 |
), |
| 2185 |
|
| 2186 |
array( |
| 2187 |
'id' => 'opt-background-2', |
| 2188 |
'type' => 'background', |
| 2189 |
'title' => 'Background with default', |
| 2190 |
'default' => array( |
| 2191 |
'background-color' => '#e80000', |
| 2192 |
'background-position' => 'center center', |
| 2193 |
'background-repeat' => 'repeat-x', |
| 2194 |
'background-attachment' => 'fixed', |
| 2195 |
'background-size' => 'cover', |
| 2196 |
) |
| 2197 |
), |
| 2198 |
|
| 2199 |
array( |
| 2200 |
'id' => 'opt-background-3', |
| 2201 |
'type' => 'background', |
| 2202 |
'title' => 'Background with all features', |
| 2203 |
'background_color' => true, |
| 2204 |
'background_image' => true, |
| 2205 |
'background-position' => true, |
| 2206 |
'background_repeat' => true, |
| 2207 |
'background_attachment' => true, |
| 2208 |
'background_size' => true, |
| 2209 |
'background_origin' => true, |
| 2210 |
'background_clip' => true, |
| 2211 |
'background_blend_mode' => true, |
| 2212 |
'background_gradient' => true, |
| 2213 |
'default' => array( |
| 2214 |
'background-color' => '#009e44', |
| 2215 |
'background-gradient-color' => '#81d742', |
| 2216 |
'background-gradient-direction' => '135deg', |
| 2217 |
'background-position' => 'center center', |
| 2218 |
'background-repeat' => 'repeat-x', |
| 2219 |
'background-attachment' => 'fixed', |
| 2220 |
'background-size' => 'cover', |
| 2221 |
'background-origin' => 'border-box', |
| 2222 |
'background-clip' => 'padding-box', |
| 2223 |
'background-blend-mode' => 'normal', |
| 2224 |
) |
| 2225 |
), |
| 2226 |
|
| 2227 |
) |
| 2228 |
) ); |
| 2229 |
|
| 2230 |
// |
| 2231 |
// Field: typography |
| 2232 |
// |
| 2233 |
CSF::createSection( $prefix, array( |
| 2234 |
'parent' => 'design_fields', |
| 2235 |
'title' => 'Typography', |
| 2236 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=typography" target="_blank">Field: typography</a>', |
| 2237 |
'fields' => array( |
| 2238 |
|
| 2239 |
array( |
| 2240 |
'id' => 'opt-typography-1', |
| 2241 |
'type' => 'typography', |
| 2242 |
'title' => 'Typography', |
| 2243 |
), |
| 2244 |
|
| 2245 |
array( |
| 2246 |
'id' => 'opt-typography-2', |
| 2247 |
'type' => 'typography', |
| 2248 |
'title' => 'Typography with default', |
| 2249 |
'default' => array( |
| 2250 |
'font-family' => 'Barlow', |
| 2251 |
'font-weight' => '600', |
| 2252 |
'subset' => 'latin-ext', |
| 2253 |
'type' => 'google', |
| 2254 |
'text-align' => 'center', |
| 2255 |
'text-transform' => 'capitalize', |
| 2256 |
'font-size' => '18', |
| 2257 |
'line-height' => '20', |
| 2258 |
'letter-spacing' => '-1', |
| 2259 |
'color' => '#009e44', |
| 2260 |
), |
| 2261 |
), |
| 2262 |
|
| 2263 |
array( |
| 2264 |
'id' => 'opt-typography-3', |
| 2265 |
'type' => 'typography', |
| 2266 |
'title' => 'Typography with few features', |
| 2267 |
'text_align' => false, |
| 2268 |
'text_transform' => false, |
| 2269 |
'font_size' => false, |
| 2270 |
'line_height' => false, |
| 2271 |
'letter_spacing' => false, |
| 2272 |
'color' => false, |
| 2273 |
'default' => array( |
| 2274 |
'font-family' => 'Lato', |
| 2275 |
'font-weight' => '900', |
| 2276 |
'subset' => 'latin', |
| 2277 |
'type' => 'google', |
| 2278 |
), |
| 2279 |
), |
| 2280 |
|
| 2281 |
|
| 2282 |
array( |
| 2283 |
'id' => 'opt-typography-4', |
| 2284 |
'type' => 'typography', |
| 2285 |
'title' => 'Typography with all features', |
| 2286 |
'font_family' => true, |
| 2287 |
'font_weight' => true, |
| 2288 |
'font_style' => true, |
| 2289 |
'font_size' => true, |
| 2290 |
'line_height' => true, |
| 2291 |
'letter_spacing' => true, |
| 2292 |
'text_align' => true, |
| 2293 |
'text-transform' => true, |
| 2294 |
'color' => true, |
| 2295 |
'subset' => true, |
| 2296 |
'backup_font_family' => true, |
| 2297 |
'font_variant' => true, |
| 2298 |
'word_spacing' => true, |
| 2299 |
'text_decoration' => true, |
| 2300 |
'default' => array( |
| 2301 |
'font-family' => 'Old Standard TT', |
| 2302 |
'type' => 'google', |
| 2303 |
), |
| 2304 |
), |
| 2305 |
|
| 2306 |
) |
| 2307 |
) ); |
| 2308 |
|
| 2309 |
// |
| 2310 |
// Field: dimensions |
| 2311 |
// |
| 2312 |
CSF::createSection( $prefix, array( |
| 2313 |
'parent' => 'design_fields', |
| 2314 |
'title' => 'Dimensions', |
| 2315 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=dimensions" target="_blank">Field: dimensions</a>', |
| 2316 |
'fields' => array( |
| 2317 |
|
| 2318 |
array( |
| 2319 |
'id' => 'opt-dimensions-1', |
| 2320 |
'type' => 'dimensions', |
| 2321 |
'title' => 'Dimensions', |
| 2322 |
), |
| 2323 |
|
| 2324 |
array( |
| 2325 |
'id' => 'opt-dimensions-2', |
| 2326 |
'type' => 'dimensions', |
| 2327 |
'title' => 'Dimensions with default', |
| 2328 |
'default' => array( |
| 2329 |
'width' => '100', |
| 2330 |
'height' => '250', |
| 2331 |
'unit' => 'px', |
| 2332 |
), |
| 2333 |
), |
| 2334 |
|
| 2335 |
array( |
| 2336 |
'id' => 'opt-dimensions-3', |
| 2337 |
'type' => 'dimensions', |
| 2338 |
'title' => 'Dimensions with custom text and units', |
| 2339 |
'width_icon' => 'width', |
| 2340 |
'height_icon' => 'height', |
| 2341 |
'units' => array( 'px', '%', 'em', 'rem', 'pt' ), |
| 2342 |
'default' => array( |
| 2343 |
'width' => '100', |
| 2344 |
'height' => '50', |
| 2345 |
'unit' => '%', |
| 2346 |
), |
| 2347 |
), |
| 2348 |
|
| 2349 |
array( |
| 2350 |
'id' => 'opt-dimensions-4', |
| 2351 |
'type' => 'dimensions', |
| 2352 |
'title' => 'Dimensions with single unit', |
| 2353 |
'units' => array( 'px' ), |
| 2354 |
), |
| 2355 |
|
| 2356 |
array( |
| 2357 |
'id' => 'opt-dimensions-5', |
| 2358 |
'type' => 'dimensions', |
| 2359 |
'title' => 'Dimensions without unit selector', |
| 2360 |
'unit' => false, |
| 2361 |
), |
| 2362 |
|
| 2363 |
array( |
| 2364 |
'id' => 'opt-dimensions-6', |
| 2365 |
'type' => 'dimensions', |
| 2366 |
'title' => 'Dimensions with only width', |
| 2367 |
'height' => false, |
| 2368 |
), |
| 2369 |
|
| 2370 |
array( |
| 2371 |
'id' => 'opt-dimensions-7', |
| 2372 |
'type' => 'dimensions', |
| 2373 |
'title' => 'Dimensions with only width and single unit', |
| 2374 |
'height' => false, |
| 2375 |
'units' => array( 'px' ), |
| 2376 |
), |
| 2377 |
|
| 2378 |
) |
| 2379 |
) ); |
| 2380 |
|
| 2381 |
// |
| 2382 |
// Field: spacing |
| 2383 |
// |
| 2384 |
CSF::createSection( $prefix, array( |
| 2385 |
'parent' => 'design_fields', |
| 2386 |
'title' => 'Spacing', |
| 2387 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=spacing" target="_blank">Field: spacing</a>', |
| 2388 |
'fields' => array( |
| 2389 |
|
| 2390 |
array( |
| 2391 |
'id' => 'opt-spacing-1', |
| 2392 |
'type' => 'spacing', |
| 2393 |
'title' => 'Spacing', |
| 2394 |
), |
| 2395 |
|
| 2396 |
array( |
| 2397 |
'id' => 'opt-spacing-2', |
| 2398 |
'type' => 'spacing', |
| 2399 |
'title' => 'Spacing with default', |
| 2400 |
'default' => array( |
| 2401 |
'top' => '50', |
| 2402 |
'right' => '100', |
| 2403 |
'bottom' => '50', |
| 2404 |
'left' => '100', |
| 2405 |
'unit' => 'px', |
| 2406 |
), |
| 2407 |
), |
| 2408 |
|
| 2409 |
array( |
| 2410 |
'id' => 'opt-spacing-2', |
| 2411 |
'type' => 'spacing', |
| 2412 |
'title' => 'Spacing without unit selector', |
| 2413 |
'units' => array( 'px' ), |
| 2414 |
'default' => array( |
| 2415 |
'top' => '50', |
| 2416 |
'right' => '100', |
| 2417 |
'bottom' => '50', |
| 2418 |
'left' => '100', |
| 2419 |
'unit' => 'px', |
| 2420 |
), |
| 2421 |
), |
| 2422 |
|
| 2423 |
array( |
| 2424 |
'id' => 'opt-spacing-3', |
| 2425 |
'type' => 'spacing', |
| 2426 |
'title' => 'Spacing with only left and right', |
| 2427 |
'top' => false, |
| 2428 |
'bottom' => false, |
| 2429 |
), |
| 2430 |
|
| 2431 |
array( |
| 2432 |
'id' => 'opt-spacing-4', |
| 2433 |
'type' => 'spacing', |
| 2434 |
'title' => 'Spacing with only top and bottom', |
| 2435 |
'left' => false, |
| 2436 |
'right' => false, |
| 2437 |
), |
| 2438 |
|
| 2439 |
array( |
| 2440 |
'id' => 'opt-spacing-5', |
| 2441 |
'type' => 'spacing', |
| 2442 |
'title' => 'Spacing with all directions', |
| 2443 |
'all' => true, |
| 2444 |
), |
| 2445 |
|
| 2446 |
) |
| 2447 |
) ); |
| 2448 |
|
| 2449 |
// |
| 2450 |
// Field: border |
| 2451 |
// |
| 2452 |
CSF::createSection( $prefix, array( |
| 2453 |
'parent' => 'design_fields', |
| 2454 |
'title' => 'Border', |
| 2455 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=border" target="_blank">Field: border</a>', |
| 2456 |
'fields' => array( |
| 2457 |
|
| 2458 |
array( |
| 2459 |
'id' => 'opt-border-1', |
| 2460 |
'type' => 'border', |
| 2461 |
'title' => 'Border', |
| 2462 |
), |
| 2463 |
|
| 2464 |
array( |
| 2465 |
'id' => 'opt-border-2', |
| 2466 |
'type' => 'border', |
| 2467 |
'title' => 'Border with default', |
| 2468 |
'default' => array( |
| 2469 |
'top' => '4', |
| 2470 |
'right' => '8', |
| 2471 |
'bottom' => '4', |
| 2472 |
'left' => '8', |
| 2473 |
'style' => 'dashed', |
| 2474 |
'color' => '#1e73be', |
| 2475 |
) |
| 2476 |
), |
| 2477 |
|
| 2478 |
array( |
| 2479 |
'id' => 'opt-border-3', |
| 2480 |
'type' => 'border', |
| 2481 |
'title' => 'Border with only left and right', |
| 2482 |
'top' => false, |
| 2483 |
'bottom' => false, |
| 2484 |
), |
| 2485 |
|
| 2486 |
array( |
| 2487 |
'id' => 'opt-border-4', |
| 2488 |
'type' => 'border', |
| 2489 |
'title' => 'Border with only top and bottom', |
| 2490 |
'left' => false, |
| 2491 |
'right' => false, |
| 2492 |
), |
| 2493 |
|
| 2494 |
array( |
| 2495 |
'id' => 'opt-border-5', |
| 2496 |
'type' => 'border', |
| 2497 |
'title' => 'Border with all directions', |
| 2498 |
'all' => true, |
| 2499 |
), |
| 2500 |
|
| 2501 |
) |
| 2502 |
) ); |
| 2503 |
|
| 2504 |
// |
| 2505 |
// Field: spinner |
| 2506 |
// |
| 2507 |
CSF::createSection( $prefix, array( |
| 2508 |
'parent' => 'design_fields', |
| 2509 |
'title' => 'Spinner', |
| 2510 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=spinner" target="_blank">Field: spinner</a>', |
| 2511 |
'fields' => array( |
| 2512 |
|
| 2513 |
array( |
| 2514 |
'id' => 'opt-spinner-1', |
| 2515 |
'type' => 'spinner', |
| 2516 |
'title' => 'Spinner', |
| 2517 |
'subtitle' => 'max:100 | min:0 | step:1', |
| 2518 |
'max' => 100, |
| 2519 |
'min' => 0, |
| 2520 |
'step' => 1, |
| 2521 |
'default' => 25, |
| 2522 |
), |
| 2523 |
|
| 2524 |
array( |
| 2525 |
'id' => 'opt-spinner-2', |
| 2526 |
'type' => 'spinner', |
| 2527 |
'title' => 'Spinner', |
| 2528 |
'subtitle' => 'max:200 | min:100 | step:10', |
| 2529 |
'max' => 200, |
| 2530 |
'min' => 100, |
| 2531 |
'step' => 10, |
| 2532 |
'default' => 100, |
| 2533 |
), |
| 2534 |
|
| 2535 |
array( |
| 2536 |
'id' => 'opt-spinner-3', |
| 2537 |
'type' => 'spinner', |
| 2538 |
'title' => 'Spinner', |
| 2539 |
'subtitle' => 'max:1 | min:0 | step:0.1 | unit:px', |
| 2540 |
'max' => 1, |
| 2541 |
'min' => 0, |
| 2542 |
'step' => 0.1, |
| 2543 |
'unit' => 'px', |
| 2544 |
'default' => 0.5, |
| 2545 |
), |
| 2546 |
|
| 2547 |
) |
| 2548 |
) ); |
| 2549 |
|
| 2550 |
// |
| 2551 |
// Field: number |
| 2552 |
// |
| 2553 |
CSF::createSection( $prefix, array( |
| 2554 |
'parent' => 'design_fields', |
| 2555 |
'title' => 'Number', |
| 2556 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=number" target="_blank">Field: number</a>', |
| 2557 |
'fields' => array( |
| 2558 |
|
| 2559 |
array( |
| 2560 |
'id' => 'opt-number-1', |
| 2561 |
'type' => 'number', |
| 2562 |
'title' => 'Number', |
| 2563 |
), |
| 2564 |
array( |
| 2565 |
'id' => 'opt-number-2', |
| 2566 |
'type' => 'number', |
| 2567 |
'title' => 'Number with unit', |
| 2568 |
'unit' => 'px', |
| 2569 |
), |
| 2570 |
array( |
| 2571 |
'id' => 'opt-number-3', |
| 2572 |
'type' => 'number', |
| 2573 |
'title' => 'Number with default', |
| 2574 |
'unit' => 'width', |
| 2575 |
'default' => 100, |
| 2576 |
), |
| 2577 |
|
| 2578 |
) |
| 2579 |
) ); |
| 2580 |
|
| 2581 |
// |
| 2582 |
// Additional Fields |
| 2583 |
// |
| 2584 |
CSF::createSection( $prefix, array( |
| 2585 |
'id' => 'additional_fields', |
| 2586 |
'title' => 'Additional Fields', |
| 2587 |
'icon' => 'fas fa-asterisk', |
| 2588 |
) ); |
| 2589 |
|
| 2590 |
// |
| 2591 |
// Field: slider |
| 2592 |
// |
| 2593 |
CSF::createSection( $prefix, array( |
| 2594 |
'parent' => 'additional_fields', |
| 2595 |
'title' => 'Slider', |
| 2596 |
'icon' => 'fas fa-sliders-h', |
| 2597 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=slider" target="_blank">Field: slider</a>', |
| 2598 |
'fields' => array( |
| 2599 |
|
| 2600 |
array( |
| 2601 |
'id' => 'opt-slider-1', |
| 2602 |
'type' => 'slider', |
| 2603 |
'title' => 'Slider', |
| 2604 |
), |
| 2605 |
|
| 2606 |
array( |
| 2607 |
'id' => 'opt-slider-2', |
| 2608 |
'type' => 'slider', |
| 2609 |
'title' => 'Slider with default', |
| 2610 |
'default' => 50, |
| 2611 |
), |
| 2612 |
|
| 2613 |
array( |
| 2614 |
'id' => 'opt-slider-3', |
| 2615 |
'type' => 'slider', |
| 2616 |
'title' => 'Slider with unit text', |
| 2617 |
'unit' => '%', |
| 2618 |
'default' => 75, |
| 2619 |
), |
| 2620 |
|
| 2621 |
array( |
| 2622 |
'id' => 'opt-slider-4', |
| 2623 |
'type' => 'slider', |
| 2624 |
'title' => 'Slider with min/max allowed value', |
| 2625 |
'subtitle' => 'Min: 1 | Max: 10 | Step: 0.1 | Default: 5.5', |
| 2626 |
'unit' => 'px', |
| 2627 |
'min' => 1, |
| 2628 |
'max' => 10, |
| 2629 |
'step' => 0.1, |
| 2630 |
'default' => 5.5, |
| 2631 |
), |
| 2632 |
|
| 2633 |
) |
| 2634 |
) ); |
| 2635 |
|
| 2636 |
// |
| 2637 |
// Field: sorter |
| 2638 |
// |
| 2639 |
CSF::createSection( $prefix, array( |
| 2640 |
'parent' => 'additional_fields', |
| 2641 |
'title' => 'Sorter', |
| 2642 |
'icon' => 'fas fa-sort-numeric-down', |
| 2643 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=sorter" target="_blank">Field: sorter</a>', |
| 2644 |
'fields' => array( |
| 2645 |
|
| 2646 |
array( |
| 2647 |
'id' => 'opt-sorter-1', |
| 2648 |
'type' => 'sorter', |
| 2649 |
'title' => 'Sorter', |
| 2650 |
'default' => array( |
| 2651 |
'enabled' => array( |
| 2652 |
'opt-1' => 'Option 1', |
| 2653 |
'opt-2' => 'Option 2', |
| 2654 |
'opt-3' => 'Option 3', |
| 2655 |
), |
| 2656 |
'disabled' => array( |
| 2657 |
'opt-4' => 'Option 4', |
| 2658 |
'opt-5' => 'Option 5', |
| 2659 |
), |
| 2660 |
), |
| 2661 |
), |
| 2662 |
|
| 2663 |
array( |
| 2664 |
'id' => 'opt-sorter-2', |
| 2665 |
'type' => 'sorter', |
| 2666 |
'title' => 'Sorter with custom title', |
| 2667 |
'enabled_title' => 'Activated', |
| 2668 |
'disabled_title' => 'Deactivated', |
| 2669 |
'default' => array( |
| 2670 |
'enabled' => array( |
| 2671 |
'opt-1' => 'Option 1', |
| 2672 |
'opt-2' => 'Option 2', |
| 2673 |
'opt-3' => 'Option 3', |
| 2674 |
), |
| 2675 |
'disabled' => array( |
| 2676 |
'opt-4' => 'Option 4', |
| 2677 |
'opt-5' => 'Option 5', |
| 2678 |
), |
| 2679 |
), |
| 2680 |
), |
| 2681 |
|
| 2682 |
array( |
| 2683 |
'id' => 'opt-sorter-3', |
| 2684 |
'type' => 'sorter', |
| 2685 |
'title' => 'Sorter with use only enabled section and without title', |
| 2686 |
'enabled_title' => false, |
| 2687 |
'disabled' => false, |
| 2688 |
'default' => array( |
| 2689 |
'enabled' => array( |
| 2690 |
'opt-1' => 'Option 1', |
| 2691 |
'opt-2' => 'Option 2', |
| 2692 |
'opt-3' => 'Option 3', |
| 2693 |
), |
| 2694 |
), |
| 2695 |
), |
| 2696 |
|
| 2697 |
) |
| 2698 |
) ); |
| 2699 |
|
| 2700 |
// |
| 2701 |
// Field: sortable |
| 2702 |
// |
| 2703 |
CSF::createSection( $prefix, array( |
| 2704 |
'parent' => 'additional_fields', |
| 2705 |
'title' => 'Sortable', |
| 2706 |
'icon' => 'fas fa-arrows-alt', |
| 2707 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=sortable" target="_blank">Field: sortable</a>', |
| 2708 |
'fields' => array( |
| 2709 |
|
| 2710 |
array( |
| 2711 |
'id' => 'opt-sortable-1', |
| 2712 |
'type' => 'sortable', |
| 2713 |
'title' => 'Sortable', |
| 2714 |
'fields' => array( |
| 2715 |
array( |
| 2716 |
'id' => 'opt-text-1', |
| 2717 |
'type' => 'text', |
| 2718 |
'title' => 'Text 1' |
| 2719 |
), |
| 2720 |
array( |
| 2721 |
'id' => 'opt-text-2', |
| 2722 |
'type' => 'text', |
| 2723 |
'title' => 'Text 2' |
| 2724 |
), |
| 2725 |
array( |
| 2726 |
'id' => 'opt-text-3', |
| 2727 |
'type' => 'text', |
| 2728 |
'title' => 'Text 3' |
| 2729 |
), |
| 2730 |
), |
| 2731 |
), |
| 2732 |
|
| 2733 |
array( |
| 2734 |
'id' => 'opt-sortable-2', |
| 2735 |
'type' => 'sortable', |
| 2736 |
'title' => 'Sortable with default', |
| 2737 |
'fields' => array( |
| 2738 |
array( |
| 2739 |
'id' => 'opt-text-1', |
| 2740 |
'type' => 'text', |
| 2741 |
'title' => 'Text 1' |
| 2742 |
), |
| 2743 |
array( |
| 2744 |
'id' => 'opt-text-2', |
| 2745 |
'type' => 'text', |
| 2746 |
'title' => 'Text 2' |
| 2747 |
), |
| 2748 |
array( |
| 2749 |
'id' => 'opt-text-3', |
| 2750 |
'type' => 'text', |
| 2751 |
'title' => 'Text 3' |
| 2752 |
), |
| 2753 |
), |
| 2754 |
'default' => array( |
| 2755 |
'opt-text-1' => 'This is text 1 default', |
| 2756 |
'opt-text-2' => 'This is text 2 default', |
| 2757 |
'opt-text-3' => 'This is text 3 default', |
| 2758 |
) |
| 2759 |
), |
| 2760 |
|
| 2761 |
) |
| 2762 |
) ); |
| 2763 |
|
| 2764 |
// |
| 2765 |
// Field: switcher |
| 2766 |
// |
| 2767 |
CSF::createSection( $prefix, array( |
| 2768 |
'parent' => 'additional_fields', |
| 2769 |
'title' => 'Switcher', |
| 2770 |
'icon' => 'fas fa-toggle-on', |
| 2771 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=switcher" target="_blank">Field: switcher</a>', |
| 2772 |
'fields' => array( |
| 2773 |
|
| 2774 |
array( |
| 2775 |
'id' => 'opt-switcher-1', |
| 2776 |
'type' => 'switcher', |
| 2777 |
'title' => 'Switcher', |
| 2778 |
), |
| 2779 |
|
| 2780 |
array( |
| 2781 |
'id' => 'opt-switcher-2', |
| 2782 |
'type' => 'switcher', |
| 2783 |
'title' => 'Switcher with default', |
| 2784 |
'default' => true, |
| 2785 |
), |
| 2786 |
|
| 2787 |
array( |
| 2788 |
'id' => 'opt-switcher-3', |
| 2789 |
'type' => 'switcher', |
| 2790 |
'title' => 'Switcher with label', |
| 2791 |
'label' => 'The label text of the switcher.', |
| 2792 |
), |
| 2793 |
|
| 2794 |
array( |
| 2795 |
'id' => 'opt-switcher-4', |
| 2796 |
'type' => 'switcher', |
| 2797 |
'title' => 'Switcher with Yes/No', |
| 2798 |
'text_on' => 'Yes', |
| 2799 |
'text_off' => 'No', |
| 2800 |
), |
| 2801 |
|
| 2802 |
array( |
| 2803 |
'id' => 'opt-switcher-4', |
| 2804 |
'type' => 'switcher', |
| 2805 |
'title' => 'Switcher with custom text Enabled/Disabled', |
| 2806 |
'text_on' => 'Enabled', |
| 2807 |
'text_off' => 'Disabled', |
| 2808 |
'text_width' => '100', |
| 2809 |
), |
| 2810 |
|
| 2811 |
) |
| 2812 |
) ); |
| 2813 |
|
| 2814 |
// |
| 2815 |
// Field: icons |
| 2816 |
// |
| 2817 |
CSF::createSection( $prefix, array( |
| 2818 |
'parent' => 'additional_fields', |
| 2819 |
'title' => 'Icons', |
| 2820 |
'icon' => 'fas fa-star', |
| 2821 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=icon" target="_blank">Field: icon</a>', |
| 2822 |
'fields' => array( |
| 2823 |
|
| 2824 |
array( |
| 2825 |
'id' => 'opt-icon-1', |
| 2826 |
'type' => 'icon', |
| 2827 |
'title' => 'Icon', |
| 2828 |
), |
| 2829 |
|
| 2830 |
array( |
| 2831 |
'id' => 'opt-icon-2', |
| 2832 |
'type' => 'icon', |
| 2833 |
'title' => 'Icon with default', |
| 2834 |
'default' => 'fas fa-check', |
| 2835 |
), |
| 2836 |
|
| 2837 |
) |
| 2838 |
) ); |
| 2839 |
|
| 2840 |
// |
| 2841 |
// Field: map |
| 2842 |
// |
| 2843 |
CSF::createSection( $prefix, array( |
| 2844 |
'parent' => 'additional_fields', |
| 2845 |
'title' => 'Map', |
| 2846 |
'icon' => 'fas fa-map-marker', |
| 2847 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=map" target="_blank">Field: map</a>', |
| 2848 |
'fields' => array( |
| 2849 |
|
| 2850 |
array( |
| 2851 |
'id' => 'opt-map-1', |
| 2852 |
'type' => 'map', |
| 2853 |
'title' => 'Map', |
| 2854 |
), |
| 2855 |
|
| 2856 |
array( |
| 2857 |
'id' => 'opt-map-2', |
| 2858 |
'type' => 'map', |
| 2859 |
'title' => 'Map with Default', |
| 2860 |
'default' => array( |
| 2861 |
'address' => 'New York, United States of America', |
| 2862 |
'latitude' => '40.7127281', |
| 2863 |
'longitude' => '-74.0060152', |
| 2864 |
'zoom' => '12', |
| 2865 |
) |
| 2866 |
), |
| 2867 |
|
| 2868 |
array( |
| 2869 |
'type' => 'submessage', |
| 2870 |
'style' => 'info', |
| 2871 |
'content' => 'Using custom <strong>address_field</strong> field in below example.', |
| 2872 |
), |
| 2873 |
|
| 2874 |
array( |
| 2875 |
'id' => 'my-address-text', |
| 2876 |
'type' => 'text', |
| 2877 |
'title' => 'Address', |
| 2878 |
), |
| 2879 |
|
| 2880 |
array( |
| 2881 |
'id' => 'opt-map-3', |
| 2882 |
'type' => 'map', |
| 2883 |
'title' => 'Map', |
| 2884 |
'desc' => 'Using custom <strong>address_field</strong> field', |
| 2885 |
'address_field' => 'my-address-text', |
| 2886 |
), |
| 2887 |
|
| 2888 |
) |
| 2889 |
) ); |
| 2890 |
|
| 2891 |
// |
| 2892 |
// Field: link |
| 2893 |
// |
| 2894 |
CSF::createSection( $prefix, array( |
| 2895 |
'parent' => 'additional_fields', |
| 2896 |
'title' => 'Link', |
| 2897 |
'icon' => 'fas fa-link', |
| 2898 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=link" target="_blank">Field: link</a>', |
| 2899 |
'fields' => array( |
| 2900 |
|
| 2901 |
array( |
| 2902 |
'id' => 'opt-link-1', |
| 2903 |
'type' => 'link', |
| 2904 |
'title' => 'Link', |
| 2905 |
), |
| 2906 |
|
| 2907 |
array( |
| 2908 |
'id' => 'opt-link-2', |
| 2909 |
'type' => 'link', |
| 2910 |
'title' => 'Link with default', |
| 2911 |
'default' => array( |
| 2912 |
'url' => 'http://codestarframework.com/', |
| 2913 |
'text' => 'Codestar Framework', |
| 2914 |
'target' => '_blank' |
| 2915 |
), |
| 2916 |
), |
| 2917 |
|
| 2918 |
) |
| 2919 |
) ); |
| 2920 |
|
| 2921 |
// |
| 2922 |
// Field: date |
| 2923 |
// |
| 2924 |
CSF::createSection( $prefix, array( |
| 2925 |
'parent' => 'additional_fields', |
| 2926 |
'title' => 'Date', |
| 2927 |
'icon' => 'fas fa-calendar', |
| 2928 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=date" target="_blank">Field: date</a>', |
| 2929 |
'fields' => array( |
| 2930 |
|
| 2931 |
array( |
| 2932 |
'id' => 'opt-date-1', |
| 2933 |
'type' => 'date', |
| 2934 |
'title' => 'Date', |
| 2935 |
), |
| 2936 |
|
| 2937 |
array( |
| 2938 |
'id' => 'opt-date-2', |
| 2939 |
'type' => 'date', |
| 2940 |
'title' => 'Date with custom settings', |
| 2941 |
'settings' => array( |
| 2942 |
'dateFormat' => 'mm/dd/yy', |
| 2943 |
'changeMonth' => true, |
| 2944 |
'changeYear' => true, |
| 2945 |
'showWeek' => true, |
| 2946 |
'showButtonPanel' => true, |
| 2947 |
'weekHeader' => 'Week', |
| 2948 |
'monthNamesShort' => array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ), |
| 2949 |
'dayNamesMin' => array( 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ), |
| 2950 |
) |
| 2951 |
), |
| 2952 |
|
| 2953 |
array( |
| 2954 |
'id' => 'opt-date-3', |
| 2955 |
'type' => 'date', |
| 2956 |
'title' => 'Date with From & To', |
| 2957 |
'from_to' => true, |
| 2958 |
), |
| 2959 |
|
| 2960 |
array( |
| 2961 |
'id' => 'opt-date-4', |
| 2962 |
'type' => 'date', |
| 2963 |
'title' => 'Date with custom texts Begin & End', |
| 2964 |
'from_to' => true, |
| 2965 |
'text_from' => 'Begin', |
| 2966 |
'text_to' => 'End', |
| 2967 |
), |
| 2968 |
|
| 2969 |
) |
| 2970 |
) ); |
| 2971 |
|
| 2972 |
// |
| 2973 |
// Field: datetime |
| 2974 |
// |
| 2975 |
CSF::createSection( $prefix, array( |
| 2976 |
'parent' => 'additional_fields', |
| 2977 |
'title' => 'Date and Time', |
| 2978 |
'icon' => 'fas fa-calendar', |
| 2979 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=date-time" target="_blank">Field: datetime</a>', |
| 2980 |
'fields' => array( |
| 2981 |
|
| 2982 |
array( |
| 2983 |
'id' => 'opt-datetime-1', |
| 2984 |
'type' => 'datetime', |
| 2985 |
'title' => 'Date', |
| 2986 |
), |
| 2987 |
|
| 2988 |
array( |
| 2989 |
'id' => 'opt-datetime-2', |
| 2990 |
'type' => 'datetime', |
| 2991 |
'title' => 'Date', |
| 2992 |
'subtitle' => 'Human-friendly Dates', |
| 2993 |
'settings' => array( |
| 2994 |
'altFormat' => 'F j, Y', |
| 2995 |
'dateFormat' => 'Y-m-d', |
| 2996 |
), |
| 2997 |
), |
| 2998 |
|
| 2999 |
array( |
| 3000 |
'id' => 'opt-datetime-3', |
| 3001 |
'type' => 'datetime', |
| 3002 |
'title' => 'Date', |
| 3003 |
'subtitle' => 'Start week on Monday', |
| 3004 |
'settings' => array( |
| 3005 |
'locale' => array( |
| 3006 |
'firstDayOfWeek' => 1, |
| 3007 |
), |
| 3008 |
), |
| 3009 |
), |
| 3010 |
|
| 3011 |
array( |
| 3012 |
'id' => 'opt-datetime-4', |
| 3013 |
'type' => 'datetime', |
| 3014 |
'title' => 'Date and Time', |
| 3015 |
'subtitle' => 'Date and Time Both', |
| 3016 |
'settings' => array( |
| 3017 |
'enableTime' => true, |
| 3018 |
'dateFormat' => 'Y-m-d H:i', |
| 3019 |
), |
| 3020 |
), |
| 3021 |
|
| 3022 |
array( |
| 3023 |
'id' => 'opt-datetime-5', |
| 3024 |
'type' => 'datetime', |
| 3025 |
'title' => 'Time', |
| 3026 |
'subtitle' => 'Only Time', |
| 3027 |
'settings' => array( |
| 3028 |
'noCalendar' => true, |
| 3029 |
'enableTime' => true, |
| 3030 |
), |
| 3031 |
), |
| 3032 |
|
| 3033 |
array( |
| 3034 |
'id' => 'opt-datetime-6', |
| 3035 |
'type' => 'datetime', |
| 3036 |
'title' => 'Time', |
| 3037 |
'subtitle' => '24-hour Time without PM:AM', |
| 3038 |
'settings' => array( |
| 3039 |
'noCalendar' => true, |
| 3040 |
'enableTime' => true, |
| 3041 |
'dateFormat' => 'H:i', |
| 3042 |
'time_24hr' => true, |
| 3043 |
), |
| 3044 |
), |
| 3045 |
|
| 3046 |
array( |
| 3047 |
'id' => 'opt-datetime-7', |
| 3048 |
'type' => 'datetime', |
| 3049 |
'title' => 'Date Range', |
| 3050 |
'subtitle' => 'Range Mode', |
| 3051 |
'settings' => array( |
| 3052 |
'mode' => 'range', |
| 3053 |
), |
| 3054 |
), |
| 3055 |
|
| 3056 |
array( |
| 3057 |
'id' => 'opt-datetime-8', |
| 3058 |
'type' => 'datetime', |
| 3059 |
'title' => 'Date From - To', |
| 3060 |
'subtitle' => 'Date with "From" and "To"', |
| 3061 |
'from_to' => true, |
| 3062 |
), |
| 3063 |
|
| 3064 |
array( |
| 3065 |
'id' => 'opt-datetime-9', |
| 3066 |
'type' => 'datetime', |
| 3067 |
'title' => 'Date Begin - End', |
| 3068 |
'subtitle' => 'Date with "Begin" and "End" Custom Text', |
| 3069 |
'from_to' => true, |
| 3070 |
'text_from' => 'Begin', |
| 3071 |
'text_to' => 'End', |
| 3072 |
), |
| 3073 |
|
| 3074 |
array( |
| 3075 |
'id' => 'opt-datetime-10', |
| 3076 |
'type' => 'datetime', |
| 3077 |
'title' => 'Date', |
| 3078 |
'subtitle' => 'Localize Example (Spanish)', |
| 3079 |
'settings' => array( |
| 3080 |
'locale' => array( |
| 3081 |
'time_24hr' => true, |
| 3082 |
'firstDayOfWeek' => 1, |
| 3083 |
'weekdays' => array( |
| 3084 |
'shorthand' => array( 'Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb' ), |
| 3085 |
'longhand' => array( |
| 3086 |
'Domingo', |
| 3087 |
'Lunes', |
| 3088 |
'Martes', |
| 3089 |
'Miércoles', |
| 3090 |
'Jueves', |
| 3091 |
'Viernes', |
| 3092 |
'Sábado', |
| 3093 |
), |
| 3094 |
), |
| 3095 |
'months' => array( |
| 3096 |
'shortland' => array( 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic' ), |
| 3097 |
'longhand' => array( |
| 3098 |
'Enero', |
| 3099 |
'Febrero', |
| 3100 |
'Marzo', |
| 3101 |
'Abril', |
| 3102 |
'Mayo', |
| 3103 |
'Junio', |
| 3104 |
'Julio', |
| 3105 |
'Agosto', |
| 3106 |
'Septiembre', |
| 3107 |
'Octubre', |
| 3108 |
'Noviembre', |
| 3109 |
'Diciembre', |
| 3110 |
), |
| 3111 |
), |
| 3112 |
), |
| 3113 |
), |
| 3114 |
), |
| 3115 |
|
| 3116 |
array( |
| 3117 |
'id' => 'opt-datetime-11', |
| 3118 |
'type' => 'datetime', |
| 3119 |
'title' => 'Date', |
| 3120 |
'subtitle' => 'Ready-Only Input', |
| 3121 |
'settings' => array( |
| 3122 |
'allowInput' => false, |
| 3123 |
), |
| 3124 |
), |
| 3125 |
|
| 3126 |
) |
| 3127 |
) ); |
| 3128 |
|
| 3129 |
// |
| 3130 |
// Field: image_select |
| 3131 |
// |
| 3132 |
CSF::createSection( $prefix, array( |
| 3133 |
'parent' => 'additional_fields', |
| 3134 |
'title' => 'Image Select', |
| 3135 |
'icon' => 'fas fa-th', |
| 3136 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=image-select" target="_blank">Field: image_select</a>', |
| 3137 |
'fields' => array( |
| 3138 |
|
| 3139 |
array( |
| 3140 |
'id' => 'opt-image-select-1', |
| 3141 |
'type' => 'image_select', |
| 3142 |
'title' => 'Image Select', |
| 3143 |
'options' => array( |
| 3144 |
'opt-1' => 'http://codestarframework.com/assets/images/placeholder/150x125-2ecc71.gif', |
| 3145 |
'opt-2' => 'http://codestarframework.com/assets/images/placeholder/150x125-e74c3c.gif', |
| 3146 |
'opt-3' => 'http://codestarframework.com/assets/images/placeholder/150x125-ffbc00.gif', |
| 3147 |
'opt-4' => 'http://codestarframework.com/assets/images/placeholder/150x125-3498db.gif', |
| 3148 |
), |
| 3149 |
), |
| 3150 |
|
| 3151 |
array( |
| 3152 |
'id' => 'opt-image-select-2', |
| 3153 |
'type' => 'image_select', |
| 3154 |
'title' => 'Image Select with default', |
| 3155 |
'options' => array( |
| 3156 |
'opt-1' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif', |
| 3157 |
'opt-2' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif', |
| 3158 |
'opt-3' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif', |
| 3159 |
'opt-4' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif', |
| 3160 |
'opt-5' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif', |
| 3161 |
'opt-6' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif', |
| 3162 |
'opt-7' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif', |
| 3163 |
), |
| 3164 |
'default' => 'opt-4' |
| 3165 |
), |
| 3166 |
|
| 3167 |
array( |
| 3168 |
'id' => 'opt-image-select-3', |
| 3169 |
'type' => 'image_select', |
| 3170 |
'title' => 'Image Select with multiple choice', |
| 3171 |
'multiple' => true, |
| 3172 |
'options' => array( |
| 3173 |
'opt-1' => 'http://codestarframework.com/assets/images/placeholder/80x80-e74c3c.gif', |
| 3174 |
'opt-2' => 'http://codestarframework.com/assets/images/placeholder/80x80-ffbc00.gif', |
| 3175 |
'opt-3' => 'http://codestarframework.com/assets/images/placeholder/80x80-3498db.gif', |
| 3176 |
'opt-4' => 'http://codestarframework.com/assets/images/placeholder/80x80-2ecc71.gif', |
| 3177 |
), |
| 3178 |
), |
| 3179 |
|
| 3180 |
array( |
| 3181 |
'id' => 'opt-image-select-4', |
| 3182 |
'type' => 'image_select', |
| 3183 |
'title' => 'Image Select with multiple choice and default', |
| 3184 |
'multiple' => true, |
| 3185 |
'options' => array( |
| 3186 |
'opt-1' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif', |
| 3187 |
'opt-2' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif', |
| 3188 |
'opt-3' => 'http://codestarframework.com/assets/images/placeholder/80x80-e74c3c.gif', |
| 3189 |
'opt-4' => 'http://codestarframework.com/assets/images/placeholder/80x80-ffbc00.gif', |
| 3190 |
'opt-5' => 'http://codestarframework.com/assets/images/placeholder/80x80-3498db.gif', |
| 3191 |
'opt-6' => 'http://codestarframework.com/assets/images/placeholder/80x80-2ecc71.gif', |
| 3192 |
'opt-7' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif', |
| 3193 |
'opt-8' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif', |
| 3194 |
), |
| 3195 |
'default' => array( 'opt-3', 'opt-4', 'opt-5', 'opt-6' ) |
| 3196 |
), |
| 3197 |
|
| 3198 |
array( |
| 3199 |
'id' => 'opt-image-select-5', |
| 3200 |
'type' => 'image_select', |
| 3201 |
'title' => 'Image Select inline style', |
| 3202 |
'inline' => true, |
| 3203 |
'options' => array( |
| 3204 |
'opt-1' => 'http://codestarframework.com/assets/images/placeholder/80x80-e74c3c.gif', |
| 3205 |
'opt-2' => 'http://codestarframework.com/assets/images/placeholder/80x80-ffbc00.gif', |
| 3206 |
'opt-3' => 'http://codestarframework.com/assets/images/placeholder/80x80-3498db.gif', |
| 3207 |
'opt-4' => 'http://codestarframework.com/assets/images/placeholder/80x80-2ecc71.gif', |
| 3208 |
), |
| 3209 |
'default' => 'opt-1' |
| 3210 |
), |
| 3211 |
|
| 3212 |
) |
| 3213 |
) ); |
| 3214 |
|
| 3215 |
// |
| 3216 |
// Field: button_set |
| 3217 |
// |
| 3218 |
CSF::createSection( $prefix, array( |
| 3219 |
'parent' => 'additional_fields', |
| 3220 |
'title' => 'Button Set', |
| 3221 |
'icon' => 'fas fa-ellipsis-h', |
| 3222 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=button-set" target="_blank">Field: button_set</a>', |
| 3223 |
'fields' => array( |
| 3224 |
|
| 3225 |
array( |
| 3226 |
'id' => 'opt-button-set-1', |
| 3227 |
'type' => 'button_set', |
| 3228 |
'title' => 'Button Set', |
| 3229 |
'options' => array( |
| 3230 |
'enabled' => 'Enabled', |
| 3231 |
'disabled' => 'Disabled', |
| 3232 |
), |
| 3233 |
), |
| 3234 |
|
| 3235 |
array( |
| 3236 |
'id' => 'opt-button-set-2', |
| 3237 |
'type' => 'button_set', |
| 3238 |
'title' => 'Button Set with default', |
| 3239 |
'options' => array( |
| 3240 |
'enabled' => 'Enabled', |
| 3241 |
'' => 'Default', |
| 3242 |
'disabled' => 'Disabled', |
| 3243 |
), |
| 3244 |
), |
| 3245 |
|
| 3246 |
array( |
| 3247 |
'id' => 'opt-button-set-3', |
| 3248 |
'type' => 'button_set', |
| 3249 |
'title' => 'Button Set', |
| 3250 |
'options' => array( |
| 3251 |
'activate' => 'Activate', |
| 3252 |
'deactivate' => 'Deactivate', |
| 3253 |
), |
| 3254 |
'default' => 'activate', |
| 3255 |
), |
| 3256 |
|
| 3257 |
array( |
| 3258 |
'id' => 'opt-button-set-4', |
| 3259 |
'type' => 'button_set', |
| 3260 |
'title' => 'Button Set', |
| 3261 |
'options' => array( |
| 3262 |
'on' => 'ON', |
| 3263 |
'off' => 'OFF', |
| 3264 |
), |
| 3265 |
'default' => 'on', |
| 3266 |
), |
| 3267 |
|
| 3268 |
array( |
| 3269 |
'id' => 'opt-button-set-5', |
| 3270 |
'type' => 'button_set', |
| 3271 |
'title' => 'Button Set with multiple choice', |
| 3272 |
'multiple' => true, |
| 3273 |
'options' => array( |
| 3274 |
'opt-1' => 'Option 1', |
| 3275 |
'opt-2' => 'Option 2', |
| 3276 |
'opt-3' => 'Option 3', |
| 3277 |
'opt-4' => 'Option 4', |
| 3278 |
'opt-5' => 'Option 5', |
| 3279 |
), |
| 3280 |
), |
| 3281 |
|
| 3282 |
array( |
| 3283 |
'id' => 'opt-button-set-6', |
| 3284 |
'type' => 'button_set', |
| 3285 |
'title' => 'Button Set with multiple choice and default', |
| 3286 |
'multiple' => true, |
| 3287 |
'options' => array( |
| 3288 |
'opt-1' => 'Option 1', |
| 3289 |
'opt-2' => 'Option 2', |
| 3290 |
'opt-3' => 'Option 3', |
| 3291 |
'opt-4' => 'Option 4', |
| 3292 |
'opt-5' => 'Option 5', |
| 3293 |
), |
| 3294 |
'default' => array( 'opt-2', 'opt-4' ) |
| 3295 |
), |
| 3296 |
|
| 3297 |
array( |
| 3298 |
'id' => 'opt-button-set-7', |
| 3299 |
'type' => 'button_set', |
| 3300 |
'title' => 'Button Set with categories', |
| 3301 |
'options' => 'categories', |
| 3302 |
), |
| 3303 |
|
| 3304 |
array( |
| 3305 |
'id' => 'opt-button-set-8', |
| 3306 |
'type' => 'button_set', |
| 3307 |
'title' => 'Button Set with tags', |
| 3308 |
'options' => 'tags', |
| 3309 |
), |
| 3310 |
|
| 3311 |
) |
| 3312 |
) ); |
| 3313 |
|
| 3314 |
// |
| 3315 |
// Dependencies |
| 3316 |
// |
| 3317 |
CSF::createSection( $prefix, array( |
| 3318 |
'title' => 'Dependencies', |
| 3319 |
'icon' => 'fas fa-code-branch', |
| 3320 |
'description' => 'Visit documentation for more details: <a href="http://codestarframework.com/documentation/#/faq?id=how-to-use-dependency" target="_blank">How to use dependencies</a>', |
| 3321 |
'fields' => array( |
| 3322 |
|
| 3323 |
array( |
| 3324 |
'type' => 'subheading', |
| 3325 |
'content' => 'Basic Dependencies', |
| 3326 |
), |
| 3327 |
|
| 3328 |
// |
| 3329 |
// Dependency example 1 |
| 3330 |
array( |
| 3331 |
'id' => 'opt-depend-switcher', |
| 3332 |
'type' => 'switcher', |
| 3333 |
'title' => 'If switched to (ON)', |
| 3334 |
), |
| 3335 |
|
| 3336 |
array( |
| 3337 |
'type' => 'notice', |
| 3338 |
'style' => 'success', |
| 3339 |
'content' => 'Success: Switched to (ON).', |
| 3340 |
'dependency' => array( 'opt-depend-switcher', '==', 'true' ), |
| 3341 |
), |
| 3342 |
|
| 3343 |
// |
| 3344 |
// Dependency example 2 |
| 3345 |
array( |
| 3346 |
'id' => 'opt-depend-text', |
| 3347 |
'type' => 'text', |
| 3348 |
'title' => 'If typed something to field', |
| 3349 |
), |
| 3350 |
|
| 3351 |
array( |
| 3352 |
'type' => 'notice', |
| 3353 |
'style' => 'success', |
| 3354 |
'content' => 'Success: You typed something.', |
| 3355 |
'dependency' => array( 'opt-depend-text', '!=', '' ), |
| 3356 |
), |
| 3357 |
|
| 3358 |
// |
| 3359 |
// Dependency example 3 |
| 3360 |
array( |
| 3361 |
'id' => 'opt-depend-select', |
| 3362 |
'type' => 'select', |
| 3363 |
'title' => 'If selected to (Blue) or (Black)', |
| 3364 |
'placeholder' => 'Select a color', |
| 3365 |
'options' => array( |
| 3366 |
'blue' => 'Blue', |
| 3367 |
'yellow' => 'Yellow', |
| 3368 |
'green' => 'Green', |
| 3369 |
'black' => 'Black', |
| 3370 |
'white' => 'White', |
| 3371 |
), |
| 3372 |
), |
| 3373 |
|
| 3374 |
array( |
| 3375 |
'type' => 'notice', |
| 3376 |
'style' => 'success', |
| 3377 |
'content' => 'Success: Selected to (Blue) or (Black).', |
| 3378 |
'dependency' => array( 'opt-depend-select', 'any', 'blue,black' ), |
| 3379 |
), |
| 3380 |
|
| 3381 |
// |
| 3382 |
// Dependency example 4 |
| 3383 |
array( |
| 3384 |
'id' => 'opt-depend-radio', |
| 3385 |
'type' => 'radio', |
| 3386 |
'title' => 'If selected to (Yes, Please)', |
| 3387 |
'inline' => true, |
| 3388 |
'options' => array( |
| 3389 |
'no' => 'No, Thanks', |
| 3390 |
'yes' => 'Yes, Please', |
| 3391 |
'any' => 'I am not sure!', |
| 3392 |
), |
| 3393 |
'default' => 'no' |
| 3394 |
), |
| 3395 |
|
| 3396 |
array( |
| 3397 |
'type' => 'notice', |
| 3398 |
'style' => 'success', |
| 3399 |
'content' => 'Success: Selected to (Yes, Please).', |
| 3400 |
'dependency' => array( 'opt-depend-radio', '==', 'yes' ), |
| 3401 |
), |
| 3402 |
|
| 3403 |
// |
| 3404 |
// Dependency example 5 |
| 3405 |
array( |
| 3406 |
'id' => 'opt-depend-checkbox', |
| 3407 |
'type' => 'checkbox', |
| 3408 |
'title' => 'If selected to (Green) or (Black)', |
| 3409 |
'inline' => true, |
| 3410 |
'options' => array( |
| 3411 |
'blue' => 'Blue', |
| 3412 |
'yellow' => 'Yellow', |
| 3413 |
'green' => 'Green', |
| 3414 |
'black' => 'Black', |
| 3415 |
'white' => 'White', |
| 3416 |
), |
| 3417 |
), |
| 3418 |
|
| 3419 |
array( |
| 3420 |
'type' => 'notice', |
| 3421 |
'style' => 'success', |
| 3422 |
'content' => 'Success: Selected to (Green).', |
| 3423 |
'dependency' => array( 'opt-depend-checkbox', 'any', 'green,black' ), |
| 3424 |
), |
| 3425 |
|
| 3426 |
// |
| 3427 |
// Dependency example 6 |
| 3428 |
array( |
| 3429 |
'id' => 'opt-depend-image-select', |
| 3430 |
'type' => 'image_select', |
| 3431 |
'title' => 'If selected to (Blue) box', |
| 3432 |
'options' => array( |
| 3433 |
'green' => 'http://codestarframework.com/assets/images/placeholder/100x80-2ecc71.gif', |
| 3434 |
'red' => 'http://codestarframework.com/assets/images/placeholder/100x80-e74c3c.gif', |
| 3435 |
'yellow' => 'http://codestarframework.com/assets/images/placeholder/100x80-ffbc00.gif', |
| 3436 |
'blue' => 'http://codestarframework.com/assets/images/placeholder/100x80-3498db.gif', |
| 3437 |
'gray' => 'http://codestarframework.com/assets/images/placeholder/100x80-555555.gif', |
| 3438 |
), |
| 3439 |
'default' => 'green', |
| 3440 |
), |
| 3441 |
|
| 3442 |
array( |
| 3443 |
'type' => 'notice', |
| 3444 |
'style' => 'success', |
| 3445 |
'content' => 'Success: Selected to (Blue) box.', |
| 3446 |
'dependency' => array( 'opt-depend-image-select', '==', 'blue' ), |
| 3447 |
), |
| 3448 |
|
| 3449 |
// |
| 3450 |
// Dependency example 6 |
| 3451 |
array( |
| 3452 |
'id' => 'opt-depend-image-select-any', |
| 3453 |
'type' => 'image_select', |
| 3454 |
'title' => 'If selected to (Red) or (Blue) box', |
| 3455 |
'options' => array( |
| 3456 |
'green' => 'http://codestarframework.com/assets/images/placeholder/100x80-2ecc71.gif', |
| 3457 |
'red' => 'http://codestarframework.com/assets/images/placeholder/100x80-e74c3c.gif', |
| 3458 |
'yellow' => 'http://codestarframework.com/assets/images/placeholder/100x80-ffbc00.gif', |
| 3459 |
'blue' => 'http://codestarframework.com/assets/images/placeholder/100x80-3498db.gif', |
| 3460 |
'gray' => 'http://codestarframework.com/assets/images/placeholder/100x80-555555.gif', |
| 3461 |
), |
| 3462 |
'default' => 'green', |
| 3463 |
), |
| 3464 |
|
| 3465 |
array( |
| 3466 |
'type' => 'notice', |
| 3467 |
'style' => 'success', |
| 3468 |
'content' => 'Success: Selected to (Red) or (Blue) box.', |
| 3469 |
'dependency' => array( 'opt-depend-image-select-any', 'any', 'red,blue' ), |
| 3470 |
), |
| 3471 |
|
| 3472 |
array( |
| 3473 |
'type' => 'subheading', |
| 3474 |
'content' => 'Visible Dependencies', |
| 3475 |
), |
| 3476 |
|
| 3477 |
// |
| 3478 |
// Dependency example 7 |
| 3479 |
array( |
| 3480 |
'id' => 'opt-depend-visible-switcher', |
| 3481 |
'type' => 'switcher', |
| 3482 |
'title' => 'Switched to (ON)', |
| 3483 |
'label' => 'Below fields are visibling instead of hiding. Switched to (ON) for use them.', |
| 3484 |
), |
| 3485 |
|
| 3486 |
array( |
| 3487 |
'id' => 'opt-depend-visible-text', |
| 3488 |
'type' => 'text', |
| 3489 |
'title' => 'Visible Text', |
| 3490 |
'dependency' => array( 'opt-depend-visible-switcher', '==', 'true', '', 'visible' ), |
| 3491 |
), |
| 3492 |
|
| 3493 |
array( |
| 3494 |
'id' => 'opt-depend-visible-select', |
| 3495 |
'type' => 'select', |
| 3496 |
'title' => 'Visible Select', |
| 3497 |
'placeholder' => 'Select an option', |
| 3498 |
'options' => array( |
| 3499 |
'opt-1' => 'Option 1', |
| 3500 |
'opt-2' => 'Option 2', |
| 3501 |
'opt-3' => 'Option 3', |
| 3502 |
), |
| 3503 |
'dependency' => array( 'opt-depend-visible-switcher', '==', 'true', '', 'visible' ), |
| 3504 |
), |
| 3505 |
|
| 3506 |
// |
| 3507 |
// Dependency example 8 |
| 3508 |
array( |
| 3509 |
'type' => 'subheading', |
| 3510 |
'content' => 'Nested Dependencies', |
| 3511 |
), |
| 3512 |
|
| 3513 |
array( |
| 3514 |
'id' => 'opt-depend-switcher-1', |
| 3515 |
'type' => 'switcher', |
| 3516 |
'title' => 'If switched to (ON) --->', |
| 3517 |
), |
| 3518 |
|
| 3519 |
array( |
| 3520 |
'id' => 'opt-depend-select-1', |
| 3521 |
'type' => 'select', |
| 3522 |
'title' => '---> and selected to (Blue)', |
| 3523 |
'placeholder' => 'Select a color', |
| 3524 |
'options' => array( |
| 3525 |
'blue' => 'Blue', |
| 3526 |
'yellow' => 'Yellow', |
| 3527 |
'green' => 'Green', |
| 3528 |
'black' => 'Black', |
| 3529 |
'white' => 'White', |
| 3530 |
), |
| 3531 |
), |
| 3532 |
|
| 3533 |
array( |
| 3534 |
'type' => 'notice', |
| 3535 |
'style' => 'success', |
| 3536 |
'content' => 'Success: Switched to (ON) and selected to (Blue).', |
| 3537 |
'dependency' => array( 'opt-depend-switcher-1|opt-depend-select-1', '==|==', 'true|blue' ), |
| 3538 |
), |
| 3539 |
|
| 3540 |
// |
| 3541 |
// Dependency example 9 |
| 3542 |
array( |
| 3543 |
'type' => 'subheading', |
| 3544 |
'content' => 'Another Nested Dependencies', |
| 3545 |
), |
| 3546 |
|
| 3547 |
array( |
| 3548 |
'id' => 'opt-nested-select-1', |
| 3549 |
'type' => 'select', |
| 3550 |
'title' => 'If selected to (Black) or (White) --->', |
| 3551 |
'placeholder' => 'Select a color', |
| 3552 |
'options' => array( |
| 3553 |
'blue' => 'Blue', |
| 3554 |
'yellow' => 'Yellow', |
| 3555 |
'green' => 'Green', |
| 3556 |
'black' => 'Black', |
| 3557 |
'white' => 'White', |
| 3558 |
), |
| 3559 |
), |
| 3560 |
|
| 3561 |
array( |
| 3562 |
'id' => 'opt-nested-select-2', |
| 3563 |
'type' => 'select', |
| 3564 |
'title' => '---> and selected to (Large) --->', |
| 3565 |
'placeholder' => 'Select a size', |
| 3566 |
'options' => array( |
| 3567 |
'small' => 'Small', |
| 3568 |
'middle' => 'Middle', |
| 3569 |
'large' => 'Large', |
| 3570 |
'xlage' => 'XLarge', |
| 3571 |
'xxlage' => 'XXLarge', |
| 3572 |
), |
| 3573 |
'dependency' => array( 'opt-nested-select-1', 'any', 'black,white' ), |
| 3574 |
), |
| 3575 |
|
| 3576 |
array( |
| 3577 |
'id' => 'opt-nested-select-3', |
| 3578 |
'type' => 'select', |
| 3579 |
'title' => '---> and selected to (Hello)', |
| 3580 |
'placeholder' => 'Select a word', |
| 3581 |
'options' => array( |
| 3582 |
'hello' => 'Hello', |
| 3583 |
'world' => 'World', |
| 3584 |
), |
| 3585 |
'dependency' => array( 'opt-nested-select-1|opt-nested-select-2', 'any|==', 'black,white|large' ), |
| 3586 |
), |
| 3587 |
|
| 3588 |
array( |
| 3589 |
'type' => 'notice', |
| 3590 |
'style' => 'success', |
| 3591 |
'content' => 'Congratulations, You are here now!', |
| 3592 |
'dependency' => array( 'opt-nested-select-1|opt-nested-select-2|opt-nested-select-3', 'any|==|==', 'black,white|large|hello' ), |
| 3593 |
), |
| 3594 |
|
| 3595 |
// |
| 3596 |
// Dependency example 10 |
| 3597 |
array( |
| 3598 |
'type' => 'subheading', |
| 3599 |
'content' => 'Contains Dependencies', |
| 3600 |
), |
| 3601 |
|
| 3602 |
array( |
| 3603 |
'id' => 'opt-depend-checkbox-1', |
| 3604 |
'type' => 'checkbox', |
| 3605 |
'title' => 'Select a color or more.', |
| 3606 |
'inline' => true, |
| 3607 |
'options' => array( |
| 3608 |
'blue' => 'Blue', |
| 3609 |
'yellow' => 'Yellow', |
| 3610 |
'green' => 'Green', |
| 3611 |
), |
| 3612 |
), |
| 3613 |
|
| 3614 |
array( |
| 3615 |
'type' => 'notice', |
| 3616 |
'style' => 'info', |
| 3617 |
'content' => 'Selected (blue) color.', |
| 3618 |
'dependency' => array( 'opt-depend-checkbox-1', 'contains', 'blue' ), |
| 3619 |
), |
| 3620 |
|
| 3621 |
array( |
| 3622 |
'type' => 'notice', |
| 3623 |
'style' => 'warning', |
| 3624 |
'content' => 'Selected (yellow) color.', |
| 3625 |
'dependency' => array( 'opt-depend-checkbox-1', 'contains', 'yellow' ), |
| 3626 |
), |
| 3627 |
|
| 3628 |
array( |
| 3629 |
'type' => 'notice', |
| 3630 |
'style' => 'success', |
| 3631 |
'content' => 'Selected (green) color.', |
| 3632 |
'dependency' => array( 'opt-depend-checkbox-1', 'contains', 'green' ), |
| 3633 |
), |
| 3634 |
|
| 3635 |
) |
| 3636 |
) ); |
| 3637 |
|
| 3638 |
// |
| 3639 |
// Validate |
| 3640 |
// |
| 3641 |
CSF::createSection( $prefix, array( |
| 3642 |
'title' => 'Validate', |
| 3643 |
'icon' => 'fas fa-check-circle', |
| 3644 |
'description' => 'Visit documentation for more details: <a href="http://codestarframework.com/documentation/#/faq?id=how-to-use-validate" target="_blank">How to use validate</a>', |
| 3645 |
'fields' => array( |
| 3646 |
|
| 3647 |
array( |
| 3648 |
'id' => 'opt-validate-1', |
| 3649 |
'type' => 'text', |
| 3650 |
'title' => 'Email validate', |
| 3651 |
'subtitle' => 'This text field only allows validated email address.', |
| 3652 |
'default' => 'info@domain.com', |
| 3653 |
'validate' => 'csf_validate_email', |
| 3654 |
), |
| 3655 |
|
| 3656 |
array( |
| 3657 |
'id' => 'opt-validate-2', |
| 3658 |
'type' => 'text', |
| 3659 |
'title' => 'Numeric validate', |
| 3660 |
'subtitle' => 'This text field only allows numbers', |
| 3661 |
'default' => '123456', |
| 3662 |
'validate' => 'csf_validate_numeric', |
| 3663 |
), |
| 3664 |
|
| 3665 |
array( |
| 3666 |
'id' => 'opt-validate-3', |
| 3667 |
'type' => 'text', |
| 3668 |
'title' => 'Required validate', |
| 3669 |
'subtitle' => 'This text field is required, cannot be pass empty.', |
| 3670 |
'default' => 'Lorem ipsum value', |
| 3671 |
'validate' => 'csf_validate_required', |
| 3672 |
), |
| 3673 |
|
| 3674 |
array( |
| 3675 |
'id' => 'opt-validate-4', |
| 3676 |
'type' => 'text', |
| 3677 |
'title' => 'URL validate', |
| 3678 |
'subtitle' => 'This text field only allows validated url address.', |
| 3679 |
'default' => 'http://codestarframework.com', |
| 3680 |
'validate' => 'csf_validate_url', |
| 3681 |
), |
| 3682 |
|
| 3683 |
) |
| 3684 |
) ); |
| 3685 |
|
| 3686 |
// |
| 3687 |
// Sanitize |
| 3688 |
// |
| 3689 |
CSF::createSection( $prefix, array( |
| 3690 |
'title' => 'Sanitize', |
| 3691 |
'icon' => 'fas fa-redo', |
| 3692 |
'description' => 'Visit documentation for more details: <a href="http://codestarframework.com/documentation/#/faq?id=how-to-use-sanitize" target="_blank">How to use sanitize</a>', |
| 3693 |
'fields' => array( |
| 3694 |
|
| 3695 |
array( |
| 3696 |
'id' => 'opt-sanitize-1', |
| 3697 |
'type' => 'text', |
| 3698 |
'title' => 'Sanitize (a) to (b)', |
| 3699 |
'subtitle' => 'Replacing letter (a) to letter (b). for eg. apple to bpple', |
| 3700 |
'sanitize' => 'csf_sanitize_replace_a_to_b' |
| 3701 |
), |
| 3702 |
|
| 3703 |
array( |
| 3704 |
'id' => 'opt-sanitize-2', |
| 3705 |
'type' => 'text', |
| 3706 |
'title' => 'Sanitize Title', |
| 3707 |
'subtitle' => 'Converting (space) to (-) and (uppercase) letters to (lowercase) letters. for eg. Hello World to hello-world', |
| 3708 |
'sanitize' => 'csf_sanitize_title' |
| 3709 |
), |
| 3710 |
|
| 3711 |
) |
| 3712 |
) ); |
| 3713 |
|
| 3714 |
// |
| 3715 |
// Field: backup |
| 3716 |
// |
| 3717 |
CSF::createSection( $prefix, array( |
| 3718 |
'title' => 'Backup', |
| 3719 |
'icon' => 'fas fa-shield-alt', |
| 3720 |
'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=backup" target="_blank">Field: backup</a>', |
| 3721 |
'fields' => array( |
| 3722 |
|
| 3723 |
array( |
| 3724 |
'type' => 'backup', |
| 3725 |
), |
| 3726 |
|
| 3727 |
) |
| 3728 |
) ); |
| 3729 |
|
| 3730 |
// |
| 3731 |
// Others |
| 3732 |
// |
| 3733 |
CSF::createSection( $prefix, array( |
| 3734 |
'title' => 'Others', |
| 3735 |
'icon' => 'fas fa-bolt', |
| 3736 |
'description' => 'Visit documentation for more details: <a href="http://codestarframework.com/documentation/#/fields?id=others" target="_blank">Others</a>', |
| 3737 |
'fields' => array( |
| 3738 |
|
| 3739 |
array( |
| 3740 |
'type' => 'heading', |
| 3741 |
'content' => 'This is a heading field', |
| 3742 |
), |
| 3743 |
|
| 3744 |
array( |
| 3745 |
'type' => 'subheading', |
| 3746 |
'content' => 'This is a subheading field', |
| 3747 |
), |
| 3748 |
|
| 3749 |
array( |
| 3750 |
'type' => 'content', |
| 3751 |
'content' => 'This is a content field', |
| 3752 |
), |
| 3753 |
|
| 3754 |
array( |
| 3755 |
'type' => 'submessage', |
| 3756 |
'style' => 'success', |
| 3757 |
'content' => 'This is a <strong>submessage</strong> field. And using style <strong>success</strong>', |
| 3758 |
), |
| 3759 |
|
| 3760 |
array( |
| 3761 |
'type' => 'content', |
| 3762 |
'content' => 'This is a content field', |
| 3763 |
), |
| 3764 |
|
| 3765 |
array( |
| 3766 |
'type' => 'submessage', |
| 3767 |
'style' => 'info', |
| 3768 |
'content' => 'This is a <strong>submessage</strong> field. And using style <strong>info</strong>', |
| 3769 |
), |
| 3770 |
|
| 3771 |
array( |
| 3772 |
'type' => 'submessage', |
| 3773 |
'style' => 'warning', |
| 3774 |
'content' => 'This is a <strong>submessage</strong> field. And using style <strong>warning</strong>', |
| 3775 |
), |
| 3776 |
|
| 3777 |
array( |
| 3778 |
'type' => 'submessage', |
| 3779 |
'style' => 'danger', |
| 3780 |
'content' => 'This is a <strong>submessage</strong> field. And using style <strong>danger</strong>', |
| 3781 |
), |
| 3782 |
|
| 3783 |
array( |
| 3784 |
'type' => 'notice', |
| 3785 |
'style' => 'success', |
| 3786 |
'content' => 'This is a <strong>notice</strong> field. And using style <strong>success</strong>', |
| 3787 |
), |
| 3788 |
|
| 3789 |
array( |
| 3790 |
'type' => 'notice', |
| 3791 |
'style' => 'info', |
| 3792 |
'content' => 'This is a <strong>notice</strong> field. And using style <strong>info</strong>', |
| 3793 |
), |
| 3794 |
|
| 3795 |
array( |
| 3796 |
'type' => 'notice', |
| 3797 |
'style' => 'warning', |
| 3798 |
'content' => 'This is a <strong>notice</strong> field. And using style <strong>warning</strong>', |
| 3799 |
), |
| 3800 |
|
| 3801 |
array( |
| 3802 |
'type' => 'notice', |
| 3803 |
'style' => 'danger', |
| 3804 |
'content' => 'This is a <strong>notice</strong> field. And using style <strong>danger</strong>', |
| 3805 |
), |
| 3806 |
|
| 3807 |
array( |
| 3808 |
'type' => 'content', |
| 3809 |
'content' => 'This is a <strong>content</strong> field. You can write some contents here.', |
| 3810 |
), |
| 3811 |
|
| 3812 |
) |
| 3813 |
) ); |
| 3814 |
|