balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

field-required-linking.php (5090B)


      1 <?php
      2 /**
      3  * Redux Framework required/linking config.
      4  * For full documentation, please visit: http://devs.redux.io/
      5  *
      6  * @package Redux Framework
      7  */
      8 
      9 defined( 'ABSPATH' ) || exit;
     10 
     11 Redux::set_section(
     12 	$opt_name,
     13 	array(
     14 		'title'      => esc_html__( 'Field Required / Linking', 'your-textdomain-here' ),
     15 		'id'         => 'required',
     16 		'desc'       => esc_html__( 'For full documentation on validation, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/configuration/fields/required.html" target="_blank">https://devs.redux.io/configuration/fields/required.html</a>',
     17 		'subsection' => true,
     18 		'fields'     => array(
     19 			array(
     20 				'id'       => 'opt-required-basic',
     21 				'type'     => 'switch',
     22 				'title'    => esc_html__( 'Basic Required Example', 'your-textdomain-here' ),
     23 				'subtitle' => wp_kses_post( __( 'Click <code>On</code> to see the text field appear.', 'your-textdomain-here' ) ),
     24 				'default'  => false,
     25 			),
     26 			array(
     27 				'id'       => 'opt-required-basic-text',
     28 				'type'     => 'text',
     29 				'title'    => esc_html__( 'Basic Text Field', 'your-textdomain-here' ),
     30 				'subtitle' => wp_kses_post( __( 'This text field is only show when the above switch is set to <code>On</code>, using the <code>required</code> argument.', 'your-textdomain-here' ) ),
     31 				'required' => array( 'opt-required-basic', '=', true ),
     32 			),
     33 			array(
     34 				'id'   => 'opt-required-divide-1',
     35 				'type' => 'divide',
     36 			),
     37 			array(
     38 				'id'       => 'opt-required-nested',
     39 				'type'     => 'switch',
     40 				'title'    => esc_html__( 'Nested Required Example', 'your-textdomain-here' ),
     41 				'subtitle' => wp_kses_post( __( 'Click <code>On</code> to see another set of options appear.', 'your-textdomain-here' ) ),
     42 				'default'  => false,
     43 			),
     44 			array(
     45 				'id'       => 'opt-required-nested-buttonset',
     46 				'type'     => 'button_set',
     47 				'title'    => esc_html__( 'Multiple Nested Required Examples', 'your-textdomain-here' ),
     48 				'subtitle' => wp_kses_post( __( 'Click any buton to show different fields based on their <code>required</code> statements.', 'your-textdomain-here' ) ),
     49 				'options'  => array(
     50 					'button-text'     => esc_html__( 'Show Text Field', 'your-textdomain-here' ),
     51 					'button-textarea' => esc_html__( 'Show Textarea Field', 'your-textdomain-here' ),
     52 					'button-editor'   => esc_html__( 'Show WP Editor', 'your-textdomain-here' ),
     53 					'button-ace'      => esc_html__( 'Show ACE Editor', 'your-textdomain-here' ),
     54 				),
     55 				'required' => array( 'opt-required-nested', '=', true ),
     56 				'default'  => 'button-text',
     57 			),
     58 			array(
     59 				'id'       => 'opt-required-nested-text',
     60 				'type'     => 'text',
     61 				'title'    => esc_html__( 'Nested Text Field', 'your-textdomain-here' ),
     62 				'required' => array( 'opt-required-nested-buttonset', '=', 'button-text' ),
     63 			),
     64 			array(
     65 				'id'       => 'opt-required-nested-textarea',
     66 				'type'     => 'textarea',
     67 				'title'    => esc_html__( 'Nested Textarea Field', 'your-textdomain-here' ),
     68 				'required' => array( 'opt-required-nested-buttonset', '=', 'button-textarea' ),
     69 			),
     70 			array(
     71 				'id'       => 'opt-required-nested-editor',
     72 				'type'     => 'editor',
     73 				'title'    => esc_html__( 'Nested Editor Field', 'your-textdomain-here' ),
     74 				'required' => array( 'opt-required-nested-buttonset', '=', 'button-editor' ),
     75 			),
     76 			array(
     77 				'id'       => 'opt-required-nested-ace',
     78 				'type'     => 'ace_editor',
     79 				'title'    => esc_html__( 'Nested ACE Editor Field', 'your-textdomain-here' ),
     80 				'required' => array( 'opt-required-nested-buttonset', '=', 'button-ace' ),
     81 			),
     82 			array(
     83 				'id'   => 'opt-required-divide-2',
     84 				'type' => 'divide',
     85 			),
     86 			array(
     87 				'id'       => 'opt-required-select',
     88 				'type'     => 'select',
     89 				'title'    => esc_html__( 'Select Required Example', 'your-textdomain-here' ),
     90 				'subtitle' => esc_html__( 'Select a different option to display its value.  Required may be used to display multiple & reusable fields', 'your-textdomain-here' ),
     91 				'options'  => array(
     92 					'no-sidebar'    => esc_html__( 'No Sidebars', 'your-textdomain-here' ),
     93 					'left-sidebar'  => esc_html__( 'Left Sidebar', 'your-textdomain-here' ),
     94 					'right-sidebar' => esc_html__( 'Right Sidebar', 'your-textdomain-here' ),
     95 					'both-sidebars' => esc_html__( 'Both Sidebars', 'your-textdomain-here' ),
     96 				),
     97 				'default'  => 'no-sidebar',
     98 				'select2'  => array( 'allowClear' => false ),
     99 			),
    100 			array(
    101 				'id'       => 'opt-required-select-left-sidebar',
    102 				'type'     => 'select',
    103 				'title'    => esc_html__( 'Select Left Sidebar', 'your-textdomain-here' ),
    104 				'data'     => 'sidebars',
    105 				'default'  => '',
    106 				'required' => array( 'opt-required-select', '=', array( 'left-sidebar', 'both-sidebars' ) ),
    107 			),
    108 			array(
    109 				'id'       => 'opt-required-select-right-sidebar',
    110 				'type'     => 'select',
    111 				'title'    => esc_html__( 'Select Right Sidebar', 'your-textdomain-here' ),
    112 				'data'     => 'sidebars',
    113 				'default'  => '',
    114 				'required' => array( 'opt-required-select', '=', array( 'right-sidebar', 'both-sidebars' ) ),
    115 			),
    116 		),
    117 	)
    118 );