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 / profile-options.php

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

91 lines 1.8 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 = '_prefix_profile_options';
8
9 //
10 // Create profile options
11 //
12 CSF::createProfileOptions( $prefix, array(
13 'data_type' => 'serialize'
14 ) );
15
16 //
17 // Create a section
18 //
19 CSF::createSection( $prefix, array(
20 'title' => 'Custom Profile Options',
21 'fields' => array(
22
23 //
24 // A text field
25 //
26 array(
27 'id' => 'opt-text',
28 'type' => 'text',
29 'title' => 'Text',
30 ),
31
32 array(
33 'id' => 'opt-textarea',
34 'type' => 'textarea',
35 'title' => 'Textarea',
36 'help' => 'The help text of the field.',
37 ),
38
39 array(
40 'id' => 'opt-upload',
41 'type' => 'upload',
42 'title' => 'Upload',
43 ),
44
45 array(
46 'id' => 'opt-switcher',
47 'type' => 'switcher',
48 'title' => 'Switcher',
49 'label' => 'The label text of the switcher.',
50 ),
51
52 array(
53 'id' => 'opt-color',
54 'type' => 'color',
55 'title' => 'Color',
56 'default' => '#3498db',
57 ),
58
59 array(
60 'id' => 'opt-checkbox',
61 'type' => 'checkbox',
62 'title' => 'Checkbox',
63 'label' => 'The label text of the checkbox.',
64 ),
65
66 array(
67 'id' => 'opt-radio',
68 'type' => 'radio',
69 'title' => 'Radio',
70 'options' => array(
71 'yes' => 'Yes, Please.',
72 'no' => 'No, Thank you.',
73 ),
74 'default' => 'yes',
75 ),
76
77 array(
78 'id' => 'opt-select',
79 'type' => 'select',
80 'title' => 'Select',
81 'placeholder' => 'Select an option',
82 'options' => array(
83 'opt-1' => 'Option 1',
84 'opt-2' => 'Option 2',
85 'opt-3' => 'Option 3',
86 ),
87 ),
88
89 )
90 ) );
91