PluginProbe
Cool Timeline (Horizontal & Vertical Timeline) / trunk
Cool Timeline (Horizontal & Vertical Timeline) vtrunk
3.4.0 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 2.2.3 2.3.3 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.6.1 2.7.1 2.8.3 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 All 79 releases
cool-timeline / admin / codestar-framework / samples / shortcode-options.php

shortcode-options.php in Cool Timeline (Horizontal & Vertical Timeline) trunk, at admin/codestar-framework/samples/shortcode-options.php

281 lines 5.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
3 //
4 // Set a unique slug-like ID
5 //
6 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
7 $prefix = 'csf_demo_shortcodes';
8
9 //
10 // Create a shortcoder
11 //
12 CSF::createShortcoder( $prefix, array(
13 // 'button_title' => 'Add Shortcode',
14 // 'select_title' => 'Select a shortcode',
15 // 'insert_title' => 'Insert Shortcode',
16 // 'show_in_editor' => true,
17 // 'gutenberg' => array(
18 // 'title' => 'CSF Shortcodes',
19 // 'description' => 'CSF Shortcode Block',
20 // 'icon' => 'screenoptions',
21 // 'category' => 'widgets',
22 // 'keywords' => array( 'shortcode', 'csf', 'insert' ),
23 // 'placeholder' => 'Write shortcode here...',
24 // )
25 ) );
26
27 //
28 // A shortcode [foo title=""]
29 //
30 CSF::createSection( $prefix, array(
31 'title' => '[foo] view: normal',
32 'view' => 'normal',
33 'shortcode' => 'foo',
34 'fields' => array(
35
36 array(
37 'id' => 'opt_title',
38 'type' => 'text',
39 'title' => 'Title',
40 ),
41
42 array(
43 'id' => 'opt_switcher',
44 'type' => 'switcher',
45 'title' => 'Switcher',
46 'label' => 'The label text of the switcher.',
47 ),
48
49 )
50 ) );
51
52 //
53 // A shortcode [foo title=""]content[/foo]
54 //
55 CSF::createSection( $prefix, array(
56 'title' => '[foo] view: normal alternative',
57 'view' => 'normal',
58 'shortcode' => 'foo',
59 'fields' => array(
60
61 array(
62 'id' => 'opt_title',
63 'type' => 'text',
64 'title' => 'Title',
65 ),
66
67 array(
68 'id' => 'opt_checkbox',
69 'type' => 'checkbox',
70 'title' => 'Options',
71 'options' => array(
72 'opt-1' => 'Option 1',
73 'opt-2' => 'Option 2',
74 'opt-3' => 'Option 3',
75 )
76 ),
77
78 array(
79 'id' => 'opt_select',
80 'type' => 'select',
81 'title' => 'Select',
82 'options' => array(
83 'opt-1' => 'Option 1',
84 'opt-2' => 'Option 2',
85 'opt-3' => 'Option 3',
86 ),
87 ),
88
89 array(
90 'id' => 'content',
91 'type' => 'textarea',
92 'title' => 'Content',
93 ),
94
95 )
96 ) );
97
98 //
99 // A shortcode [content]content[/content][content]content[/content]
100 //
101 CSF::createSection( $prefix, array(
102 'title' => '[foo] view: contents',
103 'view' => 'contents',
104 'shortcode' => 'content',
105 'fields' => array(
106
107 array(
108 'id' => 'opt_content_1',
109 'type' => 'textarea',
110 'title' => 'Content 1',
111 ),
112
113 array(
114 'id' => 'opt_content_2',
115 'type' => 'textarea',
116 'title' => 'Content 2',
117 ),
118
119 )
120 ) );
121
122 //
123 // A shortcode [opt_content_1]content[/opt_content_1][opt_content_2]content[/opt_content_2]
124 //
125 CSF::createSection( $prefix, array(
126 'title' => '[foo] view: contents alternative',
127 'view' => 'contents',
128 'fields' => array(
129
130 array(
131 'id' => 'opt_content_1',
132 'type' => 'textarea',
133 'title' => 'Content 1',
134 ),
135
136 array(
137 'id' => 'opt_content_2',
138 'type' => 'textarea',
139 'title' => 'Content 2',
140 ),
141
142 )
143 ) );
144
145 CSF::createSection( $prefix, array(
146 'title' => '[foo] view: group',
147 'view' => 'group',
148 'shortcode' => 'foo',
149 'group_shortcode' => 'nested_foo',
150 'group_fields' => array(
151
152 array(
153 'id' => 'opt_title',
154 'type' => 'text',
155 'title' => 'Title',
156 ),
157
158 array(
159 'id' => 'content',
160 'type' => 'textarea',
161 'title' => 'Content',
162 ),
163
164 )
165 ) );
166
167 CSF::createSection( $prefix, array(
168 'title' => '[foo] view: group alternative',
169 'view' => 'group',
170 'shortcode' => 'foo',
171 'fields' => array(
172
173 array(
174 'id' => 'opt_switcher',
175 'type' => 'switcher',
176 'title' => 'Switcher',
177 'label' => 'The label text of the switcher.',
178 ),
179
180 array(
181 'id' => 'opt_select',
182 'type' => 'select',
183 'title' => 'Select',
184 'options' => array(
185 'opt-1' => 'Option 1',
186 'opt-2' => 'Option 2',
187 'opt-3' => 'Option 3',
188 ),
189 ),
190
191 ),
192 'group_shortcode' => 'nested_foo',
193 'group_fields' => array(
194
195 array(
196 'id' => 'title',
197 'type' => 'text',
198 'title' => 'Title',
199 ),
200
201 array(
202 'id' => 'content',
203 'type' => 'textarea',
204 'title' => 'Content',
205 ),
206
207 )
208 ) );
209
210 CSF::createSection( $prefix, array(
211 'title' => '[foo] view: repeater',
212 'view' => 'repeater',
213 'shortcode' => 'foo',
214 'fields' => array(
215
216 array(
217 'id' => 'opt_title',
218 'type' => 'text',
219 'title' => 'Title',
220 ),
221
222 array(
223 'id' => 'opt_switcher',
224 'type' => 'switcher',
225 'title' => 'Switcher',
226 'label' => 'The label text of the switcher.',
227 ),
228
229 array(
230 'id' => 'opt_select',
231 'type' => 'select',
232 'title' => 'Select',
233 'options' => array(
234 'opt-1' => 'Option 1',
235 'opt-2' => 'Option 2',
236 'opt-3' => 'Option 3',
237 ),
238 ),
239
240 )
241 ) );
242
243 CSF::createSection( $prefix, array(
244 'title' => '[foo] view: repeater alternative',
245 'view' => 'repeater',
246 'shortcode' => 'foo',
247 'fields' => array(
248
249 array(
250 'id' => 'opt_title',
251 'type' => 'text',
252 'title' => 'Title',
253 ),
254
255 array(
256 'id' => 'opt_switcher',
257 'type' => 'switcher',
258 'title' => 'Switcher',
259 'label' => 'The label text of the switcher.',
260 ),
261
262 array(
263 'id' => 'opt_select',
264 'type' => 'select',
265 'title' => 'Select',
266 'options' => array(
267 'opt-1' => 'Option 1',
268 'opt-2' => 'Option 2',
269 'opt-3' => 'Option 3',
270 ),
271 ),
272
273 array(
274 'id' => 'content',
275 'type' => 'textarea',
276 'title' => 'Content',
277 ),
278
279 )
280 ) );
281