| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Options definitions |
| 5 |
* |
| 6 |
* @package skelet |
| 7 |
*/ |
| 8 |
|
| 9 |
// Make sure our temporary variable is empty |
| 10 |
$options = array(); |
| 11 |
|
| 12 |
$options[ 'basic_0' ] = array( |
| 13 |
'title' => __( 'Basic text field' ), |
| 14 |
'subtitle' => __( 'id: <code>basic_0</code>' ), |
| 15 |
'page' => 'page_a', |
| 16 |
'description' => '~', |
| 17 |
); |
| 18 |
|
| 19 |
$options[ 'basic_1' ] = array( |
| 20 |
'page' => 'page_a', |
| 21 |
'placeholder' => __( 'Try "123"' ), |
| 22 |
); |
| 23 |
|
| 24 |
$options[ 'basic_2' ] = array( |
| 25 |
'page' => 'page_a', |
| 26 |
'tab' => 'tab_2', |
| 27 |
); |
| 28 |
|
| 29 |
$options[ 'basic_3' ] = array( 'page' => 'page_b' ); |
| 30 |
|
| 31 |
$options[ 'basic_4' ] = array( |
| 32 |
'description' => '<p class="description">An option with default value <code>DEF</code></p>', |
| 33 |
'page' => 'page_a', |
| 34 |
'default' => 'DEF', |
| 35 |
); |
| 36 |
|
| 37 |
$options[ 'my_dropdown_single' ] = array( |
| 38 |
'page' => 'page_a', |
| 39 |
'type' => 'select', |
| 40 |
'options' => array( |
| 41 |
'' => __( 'Choose an animal' ), |
| 42 |
'bird' => __( 'Bird' ), |
| 43 |
'cat' => __( 'Cat' ), |
| 44 |
'fish' => __( 'Fish' ), |
| 45 |
), |
| 46 |
'description' => '<p class="description">' . __( 'Try <strong>Bird</strong> or <strong>Cat</strong> here and <strong>123</strong> above to show a conditional field.' ) . '</p>', |
| 47 |
); |
| 48 |
|
| 49 |
$options[ 'depenency_1' ] = array( |
| 50 |
'page' => 'page_a', |
| 51 |
'conditions' => array( |
| 52 |
array( 'basic_1', 'eq', '123' ), |
| 53 |
), |
| 54 |
); |
| 55 |
|
| 56 |
$options[ 'depenency_2' ] = array( |
| 57 |
'page' => 'page_a', |
| 58 |
'conditions' => array( |
| 59 |
array( 'basic_1', 'eq', '123' ), |
| 60 |
array( 'my_dropdown_single', 'in', 'cat,bird' ), |
| 61 |
), |
| 62 |
'description' => '~', |
| 63 |
); |
| 64 |
|
| 65 |
$options[ 'my_colorpicker' ] = array( |
| 66 |
'page' => 'page_a', |
| 67 |
'colorpicker' => true, |
| 68 |
); |
| 69 |
|
| 70 |
$options[ 'my_media' ] = array( |
| 71 |
'page' => 'page_a', |
| 72 |
'type' => 'media', |
| 73 |
'description' => '~', |
| 74 |
'placeholder' => __( 'Insert file URL' ), |
| 75 |
'button_text' => __( 'Select Media' ), |
| 76 |
); |
| 77 |
|
| 78 |
$options[ 'my_dropdown_multiple' ] = array( |
| 79 |
'page' => 'page_a', |
| 80 |
'type' => 'select', |
| 81 |
'options' => array( |
| 82 |
'bird' => __( 'Bird' ), |
| 83 |
'cat' => __( 'Cat' ), |
| 84 |
), |
| 85 |
'multiple' => TRUE, |
| 86 |
'default' => 'cat,bird', |
| 87 |
); |
| 88 |
|
| 89 |
$options[ 'my_radios' ] = array( |
| 90 |
'page' => 'page_a', |
| 91 |
'type' => 'radio', |
| 92 |
'options' => array( |
| 93 |
'bird' => __( 'Bird' ), |
| 94 |
'cat' => __( 'Cat' ), |
| 95 |
), |
| 96 |
); |
| 97 |
|
| 98 |
$options[ 'my_checkboxes_images' ] = array( |
| 99 |
'page' => 'page_a', |
| 100 |
'type' => 'checkbox', |
| 101 |
'options' => array( |
| 102 |
'pressapps' => 'http://placehold.it/120x40/35d/fff&text=pressapps', |
| 103 |
'wordpress' => 'http://placehold.it/120x40/3d5/fff&text=wordpress', |
| 104 |
'codecanyon' => 'http://placehold.it/120x40/d35/fff&text=codecanyon', |
| 105 |
), |
| 106 |
); |
| 107 |
|
| 108 |
$options[ 'my_checkboxes_images_2' ] = array( |
| 109 |
'page' => 'page_a', |
| 110 |
'type' => 'checkbox', |
| 111 |
'options' => array( |
| 112 |
'pressapps' => 'http://placehold.it/120x40/35d/fff&text=pressapps', |
| 113 |
'wordpress' => 'http://placehold.it/120x40/3d5/fff&text=wordpress', |
| 114 |
'codecanyon' => 'http://placehold.it/120x40/d35/fff&text=codecanyon', |
| 115 |
), |
| 116 |
'separator' => ' ', |
| 117 |
); |
| 118 |
|
| 119 |
$options[ 'my_checkboxes' ] = array( |
| 120 |
'page' => 'page_a', |
| 121 |
'type' => 'checkbox', |
| 122 |
'options' => array( |
| 123 |
'bird' => __( 'Bird' ), |
| 124 |
'cat' => __( 'Cat' ), |
| 125 |
), |
| 126 |
'separator' => ' | ', |
| 127 |
); |
| 128 |
|
| 129 |
$options[ 'my_posts_checkboxes' ] = array( |
| 130 |
'page' => 'page_a', |
| 131 |
'type' => 'checkbox', |
| 132 |
'options' => 'posts', |
| 133 |
); |
| 134 |
|
| 135 |
$options[ 'my_posts_multi' ] = array( |
| 136 |
'page' => 'page_a', |
| 137 |
'type' => 'select', |
| 138 |
'options' => 'posts', |
| 139 |
'multiple' => TRUE, |
| 140 |
); |
| 141 |
|
| 142 |
$options[ 'my_terms_dropdown' ] = array( |
| 143 |
'page' => 'page_a', |
| 144 |
'type' => 'radio', |
| 145 |
'options' => 'terms', |
| 146 |
'taxonomies' => array( 'post_tag' ), |
| 147 |
'args' => 'hide_empty=0', |
| 148 |
); |
| 149 |
|
| 150 |
$options[ 'my_textarea' ] = array( |
| 151 |
'type' => 'textarea', |
| 152 |
'page' => 'page_a', |
| 153 |
); |
| 154 |
|
| 155 |
$options[ 'advanced' ] = array( |
| 156 |
'title' => __( 'Advanced' ), |
| 157 |
'subtitle' => __( 'Belongs to page_a/tab_1' ), |
| 158 |
'type' => 'textarea', |
| 159 |
'page' => 'page_a', |
| 160 |
'tab' => 'tab_1', |
| 161 |
'section' => 'advanced', |
| 162 |
'section_title' => __( 'Advanced Stuff' ), |
| 163 |
'description' => '~', |
| 164 |
'editor' => TRUE, |
| 165 |
'editor_height' => 100, |
| 166 |
// 'textarea_rows' => 10, |
| 167 |
'teeny' => TRUE, |
| 168 |
'default' => 'This is the default, it appears after reset', |
| 169 |
'value' => 'This is value on page load (click reset)', |
| 170 |
); |
| 171 |
|
| 172 |
// Register options |
| 173 |
paf_options( $options ); |
| 174 |
|