This repository was archived by the owner on Feb 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.json
More file actions
925 lines (925 loc) · 242 KB
/
index.json
File metadata and controls
925 lines (925 loc) · 242 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
[
{
"uri": "https://piklist.github.io/docs/tutorials/admin-pages/creating-a-simple-admin-page/",
"title": "Building a simple Admin Page",
"tags": [],
"description": "Piklist makes it super easy to create admin pages in WordPress.",
"content": "Description Piklist makes it super easy to create admin pages in WordPress.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. First, we need to register our page with Piklist using the piklist_admin_pages filter. This filter adds additional features to the standard WordPress functions add_menu_page and add_submenu_page. Add this code to your theme\u0026rsquo;s functions.php file, or in your custom plugin.\nadd_filter('piklist_admin_pages', 'my_admin_pages'); function my_admin_pages($pages) { $pages[] = array( 'page_title' =\u0026gt; 'About this plugin' ,'menu_title' =\u0026gt; 'About' ,'menu_slug' =\u0026gt; 'about_my_plugin' ,'capability' =\u0026gt; 'manage_options' ); return $pages; } If you go to the WordPress admin you should see a menu item called \u0026ldquo;About\u0026rdquo;.\n Now, create a PHP file in your /parts/admin-pages/ folder. It doesn\u0026rsquo;t matter what you name the file. For this example we\u0026rsquo;ll call it about.php. At the top of the file, add this code: \u0026lt;?php /* * Page: about_my_plugin */ ?\u0026gt; This code tells Piklist to place the contents of this file on the about_my_plugin page. Notice that the value that goes in Page: matches the menu_slug you defined when you registered the page.\n NOTE: There are many other options you can add to the Comment Block.\n Under this comment block you can add text, html, php, etc. Anything you want to show on this page.\n For this tutorial, add the following:\n\u0026lt;p\u0026gt; Now is: \u0026lt;?php echo date('l jS \\of F Y h:i:s A'); ?\u0026gt; \u0026lt;/p\u0026gt; That\u0026rsquo;s it! You just created an Admin Page.\nFull Snippet \u0026lt;?php /* * Page: about_my_plugin */ ?\u0026gt; \u0026lt;p\u0026gt; Now is: \u0026lt;?php echo date('l jS \\of F Y h:i:s A'); ?\u0026gt; \u0026lt;/p\u0026gt; "
},
{
"uri": "https://piklist.github.io/docs/tutorials/admin-notices/building-an-admin-notice/",
"title": "Building your first Admin Notice",
"tags": [],
"description": "Piklist makes it super easy to create admin notices in WordPress.",
"content": "Description Piklist makes it super easy to create admin notices in WordPress, usually with no PHP.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. In your parts/notices/ folder create a new PHP file to hold your notice code. This file can be named anything you want. Add the following to the top of your file: \u0026lt;?php /* Notice Type: info Dismiss: true */ ?\u0026gt; This simple comment block, creates an admin notice in the WordPress \u0026ldquo;info\u0026rdquo; style. And allows the user to dismiss it.\n Underneath the comment block add your message: \u0026lt;p\u0026gt;The site will be offline tomorrow night for maintenance.\u0026lt;/p\u0026gt; That\u0026rsquo;s it!\nFull Code Snippet \u0026lt;?php /* Notice Type: info Dismiss: true */ ?\u0026gt; \u0026lt;p\u0026gt;This website will be offline tomorrow night for maintenance.\u0026lt;/p\u0026gt; "
},
{
"uri": "https://piklist.github.io/docs/tutorials/workflows/building-first-workflow/",
"title": "Building Your First Workflow",
"tags": [],
"description": "Piklist Workflows allow you to add a tabbed system on Post and User. Additionally, you can add almost anything you want to each tab.",
"content": "Piklist Workflows allow you to add a tabbed system on almost any admin page. Additionally, you can add almost anything you want to each tab.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. IMPORTANT: Each Workflow tab loads a separate page, with a new url. If you change tabs without saving you will lose your data.\nALSO IMPORTANT: Workflows control the ENTIRE page, not just what is located under the tabs.\nEach Workflow needs a minimum of two files:\nHeader file This file goes in the /workflows folder\nThe header sets the main parameters for the entire flow. Entering the parameters into a comment block is all that\u0026rsquo;s required of the header file.\nParameters Flow Define a unique name for your flow. The name will tie together all your tabs. Example: My Flow\nPage What pages the flow should display on. This can be multiple pages, separated by commas. Example: post.php, post-new.php, post-edit.php, admin.php, your_custom_setting\nPost Type For custom post type flows, please define the post type. Example: my_cpt\nHeader Tells Piklist this is a WorkFlow header file. Set this to: true.\nPosition Where on the page should the WorkFlow display. The Workflow system can currently display in five WordPress hook locations:\n'header' =\u0026gt; 'in_admin_header'\n'body' =\u0026gt; 'all_admin_notices'\n'title' =\u0026gt; 'edit_form_after_title'\n'editor' =\u0026gt; 'edit_form_after_editor'\n'profile' =\u0026gt; 'profile_personal_options'\n/* Flow: My Flow Page: post.php, post-new.php, post-edit.php, admin.php Post Type: my_cpt Header: true Position: title */ Tab file This file goes in the /workflows folder\nEach tab in your Workflow gets its own file. Each file uses a comment block to link it to a Workflow.\nTIP: You must create at least two tabs for WorkFlows to show up.\nParameters Title The title of the Workflow tab. Example: My Tab\nOrder Defines the sort order of the tabs. Example: 10\nFlow Should be the same value as the header file. Example: My Flow\nPage What pages the individual tab should display on. This can be multiple pages, separated by commas. Example: post.php, post-new.php, post-edit.php, admin.php\nDefault Sets this tab as the default tab. IMPORTANT: Only use this parameter in ONE of your WorkFlow tab files. Default: true\n/* Title: My Tab Order: 10 Flow: My Flow */ So far we\u0026rsquo;ve created a Workflow and a tab, but we have not shown any content. When you click on a tab you are defining the entire page environment, not just the environment in the tab. You have to define which meta-boxes (or user sections, settings sections, term sections, etc) are shown on the entire page, even in the sidebar. This means when a user clicks on a WorkFlow tab you can hide or show fields in the actual tab and in the sidebar.\nAssign Meta Boxes, Sections, Etc. to Workflows. ** This file goes in the /meta-boxes folder, if you want to assign meta-boxes to this workflow. If you want to assign settings sections, then this file would go in the /settings folder.\nIn this example, we are creating and assigning a meta-box.\nCreate a meta-box the way you normally would with Piklist.\nIn the comment block of your meta box file add the following two parameters:\nTab: My Tab Flow: My Flow So, if this was the original comment block for your meta box:\n/* Title: Text Fields Post Type: piklist_demo */ It would now look like this:\n/* Title: Text Fields Post Type: piklist_demo Tab: My Tab Flow: My Flow */ Your meta-box will now show up under the “My Tab” tab of your workflow.\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/dashboard-widgets/creating-a-dashboard-widget-to-show-rss-feed/",
"title": "Create a Dashboard Widget to show an RSS Feed.",
"tags": [],
"description": "Piklist makes it super easy to create Dashboard Widgets in WordPress.",
"content": "Description Piklist makes it super easy to create Dashboard Widgets in WordPress. This way you can concentrate on your widget code, and let Piklist do the hard part.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. Create a PHP file in your /parts/dashboard/ folder. It doesn\u0026rsquo;t matter what you name the file. For this example we\u0026rsquo;ll call it rss-news.php. At the top of the file, add this code: \u0026lt;?php /* Title: Piklist News Capability: read */ ?\u0026gt; This code tells Piklist to create a Dashboard Widget named \u0026ldquo;Piklist News\u0026rdquo;, and any user with the read capability can see it. If you go to your admin Dashboard you will see the widget show up.\n The next step is to add the code to grab the RSS feed and render it. We\u0026rsquo;ll use the code example for the fetch_feed example on wordpress.org. That\u0026rsquo;s it! You just created a Dashboard Widget.\nFull Snippet \u0026lt;?php /* Title: Piklist News Capability: read */ include_once( ABSPATH . WPINC . '/feed.php' ); // Get a SimplePie feed object from the specified feed source. $rss = fetch_feed( 'http://piklist.com/rss/' ); $maxitems = 0; if ( ! is_wp_error( $rss ) ) : // Checks that the object is created correctly // Figure out how many total items there are, but limit it to 5. $maxitems = $rss-\u0026gt;get_item_quantity( 5 ); // Build an array of all the items, starting with element 0 (first element). $rss_items = $rss-\u0026gt;get_items( 0, $maxitems ); endif; ?\u0026gt; \u0026lt;ul\u0026gt; \u0026lt;?php if ( $maxitems == 0 ) : ?\u0026gt; \u0026lt;li\u0026gt;\u0026lt;?php _e( 'No items', 'my-text-domain' ); ?\u0026gt;\u0026lt;/li\u0026gt; \u0026lt;?php else : ?\u0026gt; \u0026lt;?php // Loop through each feed item and display each item as a hyperlink. ?\u0026gt; \u0026lt;?php foreach ( $rss_items as $item ) : ?\u0026gt; \u0026lt;li\u0026gt; \u0026lt;a href=\u0026quot;\u0026lt;?php echo esc_url( $item-\u0026gt;get_permalink() ); ?\u0026gt;\u0026quot; title=\u0026quot;\u0026lt;?php printf( __( 'Posted %s', 'my-text-domain' ), $item-\u0026gt;get_date('j F Y | g:i a') ); ?\u0026gt;\u0026quot;\u0026gt; \u0026lt;?php echo esc_html( $item-\u0026gt;get_title() ); ?\u0026gt; \u0026lt;/a\u0026gt; \u0026lt;/li\u0026gt; \u0026lt;?php endforeach; ?\u0026gt; \u0026lt;?php endif; ?\u0026gt; \u0026lt;/ul\u0026gt; "
},
{
"uri": "https://piklist.github.io/docs/tutorials/widgets/easy-widgets/",
"title": "Easy Widgets",
"tags": [],
"description": "Building widgets with Piklist is incredibly simple. You can use a fraction of the code WordPress requires to make very powerful widgets.",
"content": "Building widgets with Piklist is incredibly simple. You can use a fraction of the code WordPress requires to make very powerful widgets. In this tutorial, we will create a widget that includes three fields: select, text and ColorPicker.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. The first step is to create the proper folder structure in your theme. Create a piklist folder, and then a parts subfolder, and then add a widgets subfolder. Next we need to create the widget files. Piklist widgets are made up of two: widget-name.php: This file holds the widget output, and is the only required file for a widget. (i.e. example.php) widget-name-form.php: Settings fields for your widget are placed in this file. (i.e. example-form.php) Widget Settings File Let’s start with example-form.php, which will hold the fields the user will fill in to control the widget. This file is only required if you want to add settings to your widget.\nNow, let’s create our first field, a text box:\npiklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'demo_text' ,'label' =\u0026gt; 'Title' ,'description' =\u0026gt; 'Field Description' ,'value' =\u0026gt; 'Default text' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); This simple array will create a text box that automatically saves as a widget setting. The 'type' =\u0026gt; 'text' variable tells Piklist what sort of field to render. Also, notice that this is very similar to the way you create fields for meta-boxes.\nNow, let’s create our select field, a select field:\npiklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'demo_select' ,'label' =\u0026gt; 'Select box' ,'description' =\u0026gt; 'Choose from the dropdown.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) ,'choices' =\u0026gt; array( 'option1' =\u0026gt; 'Option 1' ,'option2' =\u0026gt; 'Option 2' ,'option3' =\u0026gt; 'Option 3' ) )); Notice that this array is very similar to the one used to create the text box. Just two differences:\n 'type' =\u0026gt; 'select': Tells Piklist that you want to render a select field. The choices array adds your choices. That’s it! Everything else is the same.\nOne more field to go in this tutorial. Let’s create our colorPicker field. Normally, you would need to add Javascript and CSS to create this field… but not with Piklist!\npiklist('field', array( 'type' =\u0026gt; 'colorpicker' ,'field' =\u0026gt; 'demo_colorpicker' ,'label' =\u0026gt; 'Choose a color' ,'value' =\u0026gt; '#aee029' ,'description' =\u0026gt; 'Click in the box to select a color.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); Seriously, that’s all you need to create a ColorPicker field. You will notice this is pretty much the same code used to create the text box, except we set 'type' =\u0026gt; 'colorpicker'.\nFull Code Snippet for Widget Settings: example-form.php: \u0026lt;?php piklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'demo_text' ,'label' =\u0026gt; 'Text box' ,'description' =\u0026gt; 'Field Description' ,'value' =\u0026gt; 'Default text' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); piklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'demo_select' ,'label' =\u0026gt; 'Select box' ,'description' =\u0026gt; 'Choose from the dropdown.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) ,'choices' =\u0026gt; array( 'option1' =\u0026gt; 'Option 1' ,'option2' =\u0026gt; 'Option 2' ,'option3' =\u0026gt; 'Option 3' ) )); piklist('field', array( 'type' =\u0026gt; 'colorpicker' ,'field' =\u0026gt; 'demo_colorpicker' ,'label' =\u0026gt; 'Choose a color' ,'value' =\u0026gt; '#aee029' ,'description' =\u0026gt; 'Click in the box to select a color.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); Widget Output File The output file is the only required file, since settings may not be necessary for some widgets. Open example.php. At the top of the file, we will add a comment block that will control the configuration of the widget. This comment block is very similar to what you would see in a standard WordPress plugin or theme. Here are the minimum variables required:\n\u0026lt;?php /* Title: My Demo Widget Description: A description of what my widget does */ This comment block tells Piklist you want to name your widget, \u0026ldquo;My Demo Widget\u0026rdquo;, with the description showing up in the widget edit screen.\nNow let\u0026rsquo;s add the standard WordPress widget variables. These are dictated by your theme:\n\u0026lt;?php echo $before_widget; ?\u0026gt; \u0026lt;?php echo $before_title; ?\u0026gt; \u0026lt;?php echo $after_title; ?\u0026gt; \u0026lt;?php echo $after_widget; ?\u0026gt; Then add in your fields where you want them to show:\n\u0026lt;?php echo $before_widget; ?\u0026gt; \u0026lt;?php echo $before_title; ?\u0026gt; \u0026lt;?php echo $settings['demo_text']; ?\u0026gt;! \u0026lt;?php echo $after_title; ?\u0026gt; \u0026lt;?php echo $settings['demo_select']; ?\u0026gt;! \u0026lt;?php echo $settings['demo_colorpicker']; ?\u0026gt;! \u0026lt;?php echo $after_widget; ?\u0026gt; You just built a widget!\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/meta-boxes/getting-started-creating-metaboxes-and-fields/",
"title": "Getting Started with Meta-boxes and Fields",
"tags": [],
"description": "Piklist makes it radically easy to add metaboxes and fields to your posts, pages or custom post types. In this tutorial, we will create a metabox that includes three fields, select, text and ColorPicker, for standard posts.",
"content": "Description Piklist makes it radically easy to add meta-boxes and fields to your posts, pages or custom post types. In this tutorial, we will create a metabox that includes three fields, select, text and ColorPicker, for standard posts.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. Each file we add to the the meta-boxes folder will create a metabox on the post edit screen. Each field we include in this file will be part of this metabox. Fairly straightforward. Ok, let’s create our metabox file!\nCreate a new file: let’s call it demo-metabox.php. At the top of the file, we will add a comment block that will control the configuration of the metabox. This comment block is very similar to what you would see in a standard WordPress plugin or theme. Here are the minimum variables required:\n\u0026lt;?php /* Title: My Demo Metabox Post Type: post */ This comment block tells Piklist you want to name your metabox, “My Demo Metabox”, and have it display on the edit screen for a Post. To have this metabox work with a custom post type, you could also add a custom post type slug here as well. The Piklist comment block for metaboxes supports a lot more than just these two variables. You can view the full list in our docs.\nNow we start adding our fields. It’s best practice to make the “field” name all lowercase letters, numbers, and dashes or underscores, with no spaces or special characters if possible (i.e. facebook-page-url). The field label can be anything you want.\nLet’s create our first field, a text box:\npiklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'demo_text' ,'label' =\u0026gt; 'Text Box' ,'description' =\u0026gt; 'Field Description' ,'value' =\u0026gt; 'Default text' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); This simple array will create a text box that automatically saves as Post Meta.\nNow, let’s create our select field:\npiklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'demo_select' ,'label' =\u0026gt; 'Select Box' ,'description' =\u0026gt; 'Choose from the drop-down.' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) ,'choices' =\u0026gt; array( 'option1' =\u0026gt; 'Option 1' ,'option2' =\u0026gt; 'Option 2' ,'option3' =\u0026gt; 'Option 3' ) )); Notice that this array is very similar to the one used to create the text box. Just two differences:\n type =\u0026gt; select: Tells Piklist that you want to render a select field. The choices array adds your choices. That’s it! Everything else is the same.\nOne more field to go in this tutorial. Let’s create our ColorPicker field. Normally, you would need to add Javascript and CSS to create this field… but not with Piklist!\npiklist('field', array( 'type' =\u0026gt; 'colorpicker' ,'field' =\u0026gt; 'demo_colorpicker' ,'label' =\u0026gt; 'Choose a color' ,'value' =\u0026gt; '#aee029' ,'description' =\u0026gt; 'Click in the box to select a color.' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); Seriously, that’s all you need to create a ColorPicker field. You will notice this is pretty much the same code used to create the text box, except we set ‘type’ =\u0026gt; ‘colorpicker’.\nFull Code Snippet: \u0026lt;?php /* Title: My Demo Metabox Post Type: post */ piklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'demo_text' ,'label' =\u0026gt; 'Text Box' ,'description' =\u0026gt; 'Field Description' ,'value' =\u0026gt; 'Default text' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); piklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'demo_select' ,'label' =\u0026gt; 'Select Box' ,'description' =\u0026gt; 'Choose from the drop-down.' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) ,'choices' =\u0026gt; array( 'option1' =\u0026gt; 'Option 1' ,'option2' =\u0026gt; 'Option 2' ,'option3' =\u0026gt; 'Option 3' ) )); piklist('field', array( 'type' =\u0026gt; 'colorpicker' ,'field' =\u0026gt; 'demo_colorpicker' ,'label' =\u0026gt; 'Choose a color' ,'value' =\u0026gt; '#aee029' ,'description' =\u0026gt; 'Click in the box to select a color.' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); Usage Where possible, Piklist uses the default WordPress functions to get things done, and using Post Meta is no different. You can use the get_post_meta() function to pull this data into your theme. Here’s how you would use these fields in your single.php file:\necho get_post_meta($post-\u0026gt;ID, 'demo_text', true); echo get_post_meta($post-\u0026gt;ID, 'demo_select', true); echo get_post_meta($post-\u0026gt;ID, 'demo_colorpicker', true); get_post_meta() takes a second parameter, which can be set as true or false. Set to true if you want only a single row from the database, or false if you want every row it finds that matches the meta name.\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/taxonomies-terms/getting-started-taxonomies/",
"title": "Getting Started with Taxonomies and Piklist",
"tags": [],
"description": "Add some extra power to your Taxonomies by registering them the Piklist way.",
"content": "Whether you register a taxonomy via the standard WordPress function register_taxonomy, or through Piklist, you can still take advantage of many Piklist features. However, you can add some extra power to your Taxonomies by registering them the Piklist way. Piklist extends the register_taxonomy function with extra parameters to enable extra features. You can use the standard register_taxonomy parameters, plus additional ones defined by Piklist.\nTo register a Taxonomy with Piklist:\n Create a function with your Taxonomy parameters. Hook it to the piklist_taxonomies filter. This code can go in your custom plugin, or your theme’s functions.php file. add_filter('piklist_taxonomies', 'demo_type_tax'); function demo_type_tax($taxonomies) { $taxonomies[] = array( 'post_type' =\u0026gt; 'piklist_demo' ,'name' =\u0026gt; 'piklist_demo_type' ,'show_admin_column' =\u0026gt; true ,'configuration' =\u0026gt; array( 'hierarchical' =\u0026gt; true ,'labels' =\u0026gt; piklist('taxonomy_labels', 'Demo Type') ,'hide_meta_box' =\u0026gt; true ,'show_ui' =\u0026gt; true ,'query_var' =\u0026gt; true ,'rewrite' =\u0026gt; array( 'slug' =\u0026gt; 'demo-type' ) ) ); return $taxonomies; } When registering a custom taxonomy, choose how you want it to be displayed.\n If you want the taxonomy to act the same way the \u0026ldquo;tag\u0026rdquo; taxonomy works in WordPress (multifaceted), then set the value of the hierarchical parameter to false If you want your taxonomy to act the same way the \u0026ldquo;category\u0026rdquo; taxonomy works in WordPress, then set the value of the hierarchical parameter to true "
},
{
"uri": "https://piklist.github.io/docs/tutorials/updates/getting-started-with-updates/",
"title": "Getting started with updates",
"tags": [],
"description": "Use Piklist updates to run your update scripts",
"content": "If your plugin needs an update procedure, Piklist makes it quite easy. First create a php file, and drop it in the updates folder. The file name should be the current version of your plugin. So, if the update procedure is for version 2.0 of your plugin, then the file name should be 2.0.php.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. Then write your update procedure.\nExample This example is pulled from Piklist itself.\n This update scripts runs if you are upgrading from Piklist version 0.7.1. The script moves data from a legacy table to a new table, and drops the old table. You can find it in piklist/parts/updates if (!defined('ABSPATH')) exit; // Exit if accessed directly if (!class_exists('Piklist_Update_0_7_2')) { class Piklist_Update_0_7_2 { public function __construct() { add_action('admin_init', array($this, 'admin_init')); } public function admin_init() { global $wpdb; $legacy_table = $wpdb-\u0026gt;prefix . 'piklist_cpt_relate'; $count = $wpdb-\u0026gt;get_var(\u0026quot;SHOW TABLES LIKE '{$legacy_table}'\u0026quot;); // Does the legacy table exist? if (!empty($count)) { // Grab data from legacy table $data = $wpdb-\u0026gt;get_results(\u0026quot;SELECT * FROM {$legacy_table}\u0026quot;, ARRAY_A); // Move data to new table foreach ($data as $row) { $wpdb-\u0026gt;insert( $wpdb-\u0026gt;post_relationships ,$row ,array( '%d' ,'%d' ,'%d' ) ); } // Delete legacy table $wpdb-\u0026gt;query(\u0026quot;DROP TABLE IF EXISTS {$legacy_table}\u0026quot;); } } } } "
},
{
"uri": "https://piklist.github.io/docs/faq/what-is-piklist/",
"title": "What is Piklist",
"tags": [],
"description": "A brief explanation of Piklist",
"content": "What is Piklist? Piklist is an incredibly powerful framework for WordPress. When using Piklist to enhance your WordPress themes or plugins, you will be able to build more powerful, flexible websites with less code. Just install Piklist as you would a normal WordPress plugin, and then start writing code in your theme or plugin. This website should help you get started and provide a quick reference.\nMost people use Piklist to add fields in the WordPress admin area, but you can do a lot more with Piklist. Check out the main Piklist help section to learn more.\nPiklist is a code-based framework, which means it has no user interface. We believe this is one of the biggest benefits to using Piklist. Code based systems allow you flexibility in your field configurations and development, and will save you time in the long run. With Piklist you can usually use the same code you have written in one section and use it in another, allowing you to copy and paste, and save tons of time.\nWe’ve worked hard to make Piklist easy to use for beginners, and powerful enough for developers… and our users all agree!\nThere’s jQuery-for-Javascript and Rails-for-Ruby. Now there is Piklist-for-WordPress.\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/workflows/adding-subtabs-to-workflows/",
"title": "Adding SubTabs to Workflows",
"tags": [],
"description": "Piklist Workflow tabs can be enhanced with subtabs.",
"content": "Piklist Workflow tabs can be enhanced with unlimited subtabs, allowing you to create more complex, but easy to manage, user interfaces.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. IMPORTANT: You should already have a Piklist Workflow system set up before using this tutorial. If you do not, you can reference this tutorial.\nIn this example, we are going to place a subtab under a tab called My Tab.\n Create a file under the /workflows folder. The file header can contain all the parameters you use for a normal Workflow file. Additionally, you will add a Tab parameter which defines which tab your subtab will display under. The following code snippet will display a subtab titled My Subtab, under a tab called My Tab in the My Workflow Flow, and make it the default tab.\n\u0026lt;?php /* Title: My Subtab Order: 10 Flow: My Workflow Tab: My Tab Default: true */ ?\u0026gt; "
},
{
"uri": "https://piklist.github.io/docs/about-piklist/",
"title": "About Piklist",
"tags": [],
"description": "Piklist is a fast and concise plugin that encourages WordPress rapid development. It simplifies many of the more difficult tasks in WordPress and adds functionality not presently common in WordPress core.",
"content": "The most powerful framework available for WordPress. Built for Developers. Piklist is a fast and concise plugin that encourages WordPress rapid development. It simplifies many of the more difficult tasks in WordPress and adds functionality not presently common in WordPress core.\nWhether it\u0026rsquo;s adding simple custom fields or more complex, conditionally driven forms, you can always do more in less time with Piklist.\nIf you can build it with WordPress, Piklist will make it better. Piklist is a layer that works between you and WordPress, reducing redundant code, extending core API’s and just plain super-charging WordPress. Anything you build with WordPress will be better with Piklist…anything.\nBuild plugins for Piklist. Piklist is a code based framework, so everything you build can easily be distributed. Your own plugins can now take advantage of the Piklist framework.\nAdd Piklist to your Theme. Piklist functionality can easily be added to your themes as well. Parent themes or child themes, it doesn\u0026rsquo;t matter. Piklist plays well with them all.\n"
},
{
"uri": "https://piklist.github.io/docs/faq/how-to-include-piklist-in-plugin-or-theme/",
"title": "How do I include Piklist in my plugin or theme?",
"tags": [],
"description": "Using Piklist with your plugin or theme.",
"content": "While we understand why you may want to include Piklist in your plugin or theme, we believe it may negatively impact your users’ experience. Piklist is not a boilerplate framework and is always designed to be a standalone plugin. Piklist will not work properly if included in another plugin or theme.\nIf the user does install Piklist as a separate plugin, AND your plugin/theme, it invites multiple conflicts, including different versions of Piklist. This can cause your plugin, or other plugins/themes that rely on Piklist, not to work properly. In addition, you become solely responsible for keeping your code updated with the latest version of Piklist, instead of letting the user upgrade normally.\nAdditionally, if you plan on submitting your code to WordPress.org, they do not accept a plugin that includes an entire other plugin, inside it.\nTo make it easier for you to build your plugin on Piklist, we have created the Piklist Checker. By including the Checker in your plugin, your users will be notified if Piklist is not installed, and they will be walked through the installation.\nWe hope you agree that keeping Piklist as a separate plugin makes sense for both you and your users. If not, there are other frameworks you can choose from that are designed to be included in plugins and themes.\n"
},
{
"uri": "https://piklist.github.io/docs/getting-started/built-in-demos/",
"title": "Built-in Demos",
"tags": [],
"description": "You can get a good overview of what Piklist is capable of by activating the included “Piklist Demos” add-on.",
"content": "Piklist allows you to work with WordPress like never before. At its basic level, you can easily create metaboxes/metafields (also known as custom fields) for Posts, Pages, media and user profiles, as well as easy Settings pages, Widgets and Dashboard Widgets. You will need to write a little bit of code to use Piklist, but it’s minimal and we’ve included lots of examples. Let’s get started!\n Install Piklist like you would any other Plugin. Once installed, activate Piklist. You will see a Piklist item in your WordPress menu. Now you can start adding power to your theme and plugins. Check out our tutorials for a detailed overview. Included Demos You can get a good overview of what Piklist is capable of by activating the included “Piklist Demos” add-on:\n Hover over the “Piklist” menu item, and then click on “Settings”. You should now see options for Settings. Under the Add-ons tab is the “Extend Piklist” area containing the “Piklist Demos” add-on. Click on “Activate”, and then on “Save Changes”. You will now have access to the Piklist Demos: Custom Post Type and Settings: Go to Piklist Demos \u0026gt; Add New. Create a new demo here and it will show up under Piklist Demos.\nSample Widgets: Go to Appearance \u0026gt; Widgets \u0026gt; Piklist Demo Widgets.\nUsage Piklist checker is designed to be easy to include in your plugin.\nInclude the Piklist Checker file in your Piklist plugin or theme. You can always get the most up-to-date version of Piklist Checker at WordPress.org.\nPlugin Add the following to your plugin. Notice the checker code is wrapped in a function that hooks to the init action. Theme If you’re using Piklist in your theme, this code should go in the functions.php file. Notice the added parameter after __FILE__: Example You can find an example of implementing the Piklist Checker in the WordPress Helpers plugin.\n"
},
{
"uri": "https://piklist.github.io/docs/getting-started/",
"title": "Getting Started",
"tags": [],
"description": "Getting started with Piklist.",
"content": "Getting Started with Piklist To get the most out of this tutorial you should have a recent version of WordPress running and the Piklist plugin installed and activated. If you are not running WordPress locally, then you will need FTP access to your site so you can upload files.\nWhat is Piklist? At its very basic level, Piklist is a rapid development framework for WordPress. When using Piklist to build your WordPress themes or plugins, you will be able to build more powerful, flexible websites with less code.\nYou install and activate Piklist like any other WordPress plugin. It is absolutely free. Built-in demos are included, so you can see some of the features of Piklist in action.\nPiklist is a code-based framework, which means it has no user interface. We believe this is one of the biggest benefits to using Piklist. Code based systems allow you flexibility in your field configurations and development, and will save you time in the long run. With Piklist you can usually use the same code you have written in one section and use it in another, allowing you to copy and paste, and save tons of time.\nWe’ve worked hard to make Piklist easy to use for beginners, and powerful enough for developers… and our users all agree!\nAbout this Tutorial Piklist is an incredibly powerful framework for WordPress. This tutorial only covers one feature of Piklist… adding custom fields. There is a lot more that Piklist can do, so check out the rest of the User Guide when you’ve finished this tutorial.\nLet’s get started!\nYou can easily create your project in a new or existing plugin, or your theme. In this tutorial we’ll create the project in your theme.\nPiklist Folder Structure To help keep your code organized, Piklist uses a pre-defined folder/file structure that makes it easy for you to add functionality to your site.\nPiklist utilizes a folder for each major section of WordPress. You create these folders in your theme or your plugin and place the appropriate files in them. Piklist will automatically load these files correctly.\nIMPORTANT: You create the folder structure in YOUR theme or YOUR plugin, NOT in Piklist itself. Choosing to create the folder structure in your theme or plugin is a matter of preference. For example, if you may change themes in the future, then a plugin is a better option. However, if you choose a plugin, then you need to first create a WordPress plugin, before adding the Piklist folder structure.\nFolder Structure for your theme If you want to use your theme for your Piklist files, open your theme’s main folder and add a folder called “piklist”. Inside that folder add another called “parts” and then add any Piklist folders you will need. Your folder structure should look like this:\n/theme-folder /piklist /parts /admin-pages (Do not use for settings pages) /dashboard /help /media /meta-boxes /notices /pointers /settings /terms /updates /users /widgets /workflows Folder Structure for your plugin You can also create a Piklist plugin if you want. The folder structure is slightly different than the one for a theme. Open your plugin’s main folder and add a “parts” folder. In that folder add any folders you will need. Your folder structure should look like this:\n/plugin-folder /parts /admin-pages (Do not use for settings pages) /dashboard /help /media /meta-boxes /notices /pointers /settings /terms /updates /users /widgets /workflows When creating a plugin you need let Piklist know this plugin depends on it. In the comment block of your main plugin file, you need to add: Plugin Type: Piklist. So your comment block should look something like this:\n/** * Plugin Name: Name Of The Plugin * Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates * Description: A brief description of the Plugin. * Version: The Plugin\u0026#39;s Version Number, e.g.: 1.0 * Author: Name Of The Plugin Author * Author URI: http://URI_Of_The_Plugin_Author * Plugin Type: Piklist */ A more detailed doc on writing Piklist plugins can be found here: Writing a Plugin for Piklist\nGrouping fields Overview Now that we have our folder structure set up, it’s time to add some files. Each file you add to a parts folder will contain your fields. These files allow you to group fields together and you can also have multiple files in each parts folder. For example, each file in the “meta-boxes” folder will create a metabox for a Post Type. Each file in the “users” folder will create a user field section. Each file in the “widgets” folder will create a Widget (yes, you can easily create widgets with Piklist). [TODO: ADD LINK]\nComment blocks Configuration options for each field group are defined in the comment block at the top of each file. These comment blocks are similar to what WordPress uses for plugin headers. They allow you to easily configure a group of fields with no hooks or filters.\nA full list of Comment Block parameters can be found here.\nCreate a new file in your “meta-boxes” folder called my-fields.php. At the top of the file, add this comment block:\n\u0026lt;?php /** * Title: My custom fields * Post Type: post */ In this comment block you just defined two configuration parameters: Title: The title of your metabox. Post Type: Which post type(s) should display this metabox.\nSave the file. Now open WordPress and go to “Add new Post”. You should see an empty metabox with the title “My custom fields”. You just created your first metabox with Piklist!\nConfiguration Options The comment block at the top of each parts file defines configuration options for a field group. Each field type (i.e. metaboxes, settings, widgets, etc) have different configuration options. Some configuration parameters can take multiple values. For example, the “Post Type” parameter can accept multiple Post Types separated by commas.\nChange the “Post Type” parameter to this: Post Type: post, page so your code will look like this:\n\u0026lt;?php /** * Title: My custom fields * Post Type: post, page */ Save the file. Open WordPress and add a new Page. You will see the same empty metabox that you added to Posts. Using this method you can easily use the same field code to multiple Post Types.\nAdding Fields Overview Piklist fields can be added almost anywhere in WordPress by using a very simple function. In most cases, the code you use to create a field in one area of WordPress can be used in all other areas as well. So, for example, if you already created a field for a Post Type and you also wanted to use it for a User Profile page, you can just copy and paste it.\nFields Now that we created our metabox, it’s time to add some fields. Under the comment block add the following field code so your file looks like this:\n\u0026lt;?php /** * Title: My custom fields * Post Type: post, page */ piklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'field_one' ,'label' =\u0026gt; 'First Field' )); The piklist(\u0026lsquo;field\u0026rsquo;) function accepts tons of parameters. This example used just three:\ntype: The type of field. In this case “text”.\nfield: The name of the field. This is where the field data will be saved in the database.\nlabel: A label that displays next to the field.\nSave the file. Go back to WordPress and add a new Post or a new Page. You will see a text field with the label “First Field” in your metabox.\nAdd more fields Now go back to your file, copy the field code (not the comment block), and paste it under the first field. Change the type to colorpicker, the field parameter to ‘field_two’, and the label to ‘Second field’. Your file should now look like this:\n\u0026lt;?php /** * Title: My custom fields * Post Type: post, page */ piklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'field_one' ,'label' =\u0026gt; 'First Field' )); piklist('field', array( 'type' =\u0026gt; 'colorpicker' ,'field' =\u0026gt; 'field_two' ,'label' =\u0026gt; 'Second Field' )); Save the file. Go back to WordPress and add a new Post or Page. You now have two fields: a text box and a colorpicker.\nClick inside the field and a color palette will pop up. You just created a colorpicker field by copying your existing text field code and making a few small changes.\nUtilizing the same code everywhere. As mentioned in the Tutorial introduction, one of the biggest benefits of Piklist is that it’s a code-based framework. You can easily copy and paste your code from one object type to another.\nCopy and Paste programming In the “users” folder you created in step 3, create a new file. Now open the file in your “meta-boxes” folder, select everything and copy. Open the file in your users folder and paste. The file in your “users” folder should be an exact duplicate of the one that’s in your “meta-boxes” folder.\nSince Users aren’t a Post Type, delete the line in your comment block that says: Post Type: post, page. Your file should look like this:\n\u0026lt;?php /** * Title: My custom fields */ piklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;text\u0026#39; ,\u0026#39;field\u0026#39; =\u0026gt; \u0026#39;field_one\u0026#39; ,\u0026#39;label\u0026#39; =\u0026gt; \u0026#39;First Field\u0026#39; )); piklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;colorpicker\u0026#39; ,\u0026#39;field\u0026#39; =\u0026gt; \u0026#39;field_two\u0026#39; ,\u0026#39;label\u0026#39; =\u0026gt; \u0026#39;Second Field\u0026#39; )); Press save. Open WordPress and edit any users profile. You will see this field under the section “My custom fields”.\nYou just utilized the same code for a User Profile, that you wrote for a Post Type. This is a huge time saver and you will find this feature invaluable.\nBuilt-in Demos Now that you understand how easy it is to create fields with Piklist, we’re sure you’re excited to get started. To help you along, Piklist comes with built-in demos that contain tons of field configurations that you can easily copy and paste into your own project. You can learn more about Piklist Demos here.\nVideo Overview The initial public unveiling of Piklist at WordCampNYC 2012. "
},
{
"uri": "https://piklist.github.io/docs/faq/fields-not-saving/",
"title": "Why aren’t my fields saving?",
"tags": [],
"description": "The most common reason for fields is a conflict with the WordPress “custom fields” meta box.",
"content": "The most common reason for fields not saving is because a post type uses the default WordPress “custom fields” meta box. This meta box actually duplicates the inputs used by your fields.\nIf you are registering a post type, make sure custom-fields is not in the “supports” array.\nTo remove the custom-fields meta box from a WordPress default post type, or one that is registered by another plugin, use remove_post_type_support().\nThis code should go in your theme\u0026rsquo;s functions.php file, or your plugin file.\n "
},
{
"uri": "https://piklist.github.io/docs/faq/number-of-fields-limit/",
"title": "Is there a limit on the number of Piklist fields?",
"tags": [],
"description": "How to fix field limit issues.",
"content": "There is no limit to how many fields you can create and display with Piklist. However, your server limits how many can be used on each page.\nThis is not a Piklist issue\u0026hellip; it\u0026rsquo;s part of your servers configuration.\nThe most common solution is adjusting your max_vars setting. This is a PHP setting which sets the maximum variables that can be used in one page load.\nOnce you increase this limit, Piklist can finish rendering all it\u0026rsquo;s fields.\nYou can change the setting in either your php.ini, or .htaccess file:\nphp.ini max_input_vars = 3000 suhosin.get.max_vars = 3000 suhosin.post.max_vars = 3000 suhosin.request.max_vars = 3000 .htaccess php_value max_input_vars 3000 php_value suhosin.get.max_vars 3000 php_value suhosin.post.max_vars 3000 php_value suhosin.request.max_vars 3000 "
},
{
"uri": "https://piklist.github.io/docs/faq/update-script-not-running/",
"title": "Update script not running",
"tags": [],
"description": "Fix update script issues.",
"content": "Piklist allows you to easily create update scripts that run on certain versions of your plugin. If the script doesn\u0026rsquo;t run, you may have an issue with the piklist_active_plugin_versions setting:\n Backup your database Note which version of Piklist you are currently running. Deactivate and delete Piklist Open your database. In the wp_options table, look for this field: piklist_active_plugin_versions and delete it. Reinstall the same version of Piklist you had before. You can download older versions of Piklist from the bottom of this screen. The piklist_active_plugin_versions should come back to your db. Log back into WordPress. Upgrade Piklist to the latest version. The update script should run. "
},
{
"uri": "https://piklist.github.io/docs/getting-started/piklist-enable-your-theme/",
"title": "Piklist enable your theme",
"tags": [],
"description": "Adding Piklist meta-boxes, fields, settings pages, Widgets, etc. to your theme is very easy.",
"content": "Adding Piklist meta-boxes, fields, settings pages, Widgets, etc. to your theme is very easy.\n First you need to add the proper folder structure to your theme. Piklist works by searching the active theme for the /piklist folder and then processing the sub-folders and files within it.\n Most Piklist code will go in the folder structure you set up. But other Piklist code, like registering Post Types, would go in your theme’s functions.php file.\n IMPORTANT You cannot include the Piklist plugin in your theme. It needs to remain a separate plugin.\n"
},
{
"uri": "https://piklist.github.io/docs/fields/types/",
"title": "Field Types",
"tags": [],
"description": "Piklist supports tons of field types, or you can create your own.",
"content": "Piklist supports all these field types, or you can create your own.\ncheckbox Field\n color Field\n colorpicker Field\n date Field\n datepicker Field\n editor Field\n email Field\n file (upload) Field\n group Field\n hidden Field\n html Field\n month Field\n number Field\n radio Field\n range Field\n search Field\n select Field\n tel Field\n text Field\n textarea Field\n time Field\n url Field\n week Field\n "
},
{
"uri": "https://piklist.github.io/docs/fields/sanitizing-fields/",
"title": "Sanitizing Fields",
"tags": [],
"description": "When writing field code, whether with Piklist or not, you should be extra cautious of how you handle data coming into WordPress and how it’s presented to the end user. Piklist makes sanitizing your data easy with the `sanitize` parameter.",
"content": "When writing field code, whether with Piklist or not, you should be extra cautious of how you handle data coming into WordPress and how it’s presented to the end user. Piklist makes sanitizing your data easy with the sanitize parameter.\nChoose the appropriate type of sanitization for each of your fields.\nemail Strips out all characters that are not allowable in an email address.\nCodex reference for parameters: sanitize_email\n\u0026#39;sanitize\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;email\u0026#39; ) ) file_name Removes special characters that are illegal in filenames on certain operating systems and special characters requiring special escaping to manipulate at the command line. Replaces spaces and consecutive dashes with a single dash. Trim period, dash and underscore from beginning and end of filename.\nCodex reference for parameters: sanitize_file_name\n\u0026#39;sanitize\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;file_name\u0026#39; ) ) html_class Sanitizes a html classname to ensure it only contains valid characters.\nCodex reference for parameters: sanitize_html_class\n\u0026#39;sanitize\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;html_class\u0026#39; ,\u0026#39;options\u0026#39; =\u0026gt; array( \u0026#39;fallback\u0026#39; =\u0026gt; \u0026#39;my-default-class\u0026#39; ) ) ) text_field Checks for invalid UTF-8, Convert single \u0026lt; characters to entity, strip all tags, remove line breaks, tabs and extra white space, strip octets.\nCodex reference for parameters: sanitize_text_field\n\u0026#39;sanitize\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;text_field\u0026#39; ) ) title Specifically, HTML and PHP tags are stripped, and (in a ‘save’ context) accents are removed (accented characters are replaced with non-accented equivalents). Despite the name of this function, the returned value is intended to be suitable for use in a URL, not as a human-readable title.\nCodex reference for parameters: sanitize_title\n\u0026#39;sanitize\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;title\u0026#39; ,\u0026#39;options\u0026#39; =\u0026gt; array( \u0026#39;fallback\u0026#39; =\u0026gt; \u0026#39;my-fallback-title\u0026#39; ) ,\u0026#39;context\u0026#39; =\u0026gt; \u0026#39;save\u0026#39; ) ) user Sanitize username stripping out unsafe characters.\nCodex reference for parameters: sanitize_user\n\u0026#39;sanitize\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;user\u0026#39; ,\u0026#39;options\u0026#39; =\u0026gt; array( \u0026#39;strict\u0026#39; =\u0026gt; \u0026#39;true\u0026#39; ) ) ) wp_filter_kses Sanitize content with allowed HTML Kses rules.\nCodex reference for parameters: wp_filter_kses\n\u0026#39;sanitize\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;wp_filter_kses\u0026#39; ) ) wp_kses Makes sure that only the allowed HTML element names, attribute names and attribute values plus only sane HTML entities will be saved.\nCodex reference for parameters: wp_kses\n\u0026#39;sanitize\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;wp_kses\u0026#39; ,\u0026#39;options\u0026#39; =\u0026gt; array( \u0026#39;allowed_html\u0026#39; =\u0026gt; array( \u0026#39;strong\u0026#39; =\u0026gt; array() ,\u0026#39;a\u0026#39; =\u0026gt; array( \u0026#39;href\u0026#39; =\u0026gt; array() ,\u0026#39;title\u0026#39; =\u0026gt; array() ) ) ,\u0026#39;allowed_protocols\u0026#39; =\u0026gt; array(\u0026#39;http\u0026#39;) ) ) ) wp_kses Makes sure that only the allowed HTML element names, attribute names and attribute values plus only sane HTML entities will be saved.\nCodex reference for parameters: wp_kses\n\u0026#39;sanitize\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;wp_kses\u0026#39; ,\u0026#39;options\u0026#39; =\u0026gt; array( \u0026#39;allowed_html\u0026#39; =\u0026gt; array( \u0026#39;strong\u0026#39; =\u0026gt; array() ,\u0026#39;a\u0026#39; =\u0026gt; array( \u0026#39;href\u0026#39; =\u0026gt; array() ,\u0026#39;title\u0026#39; =\u0026gt; array() ) ) ,\u0026#39;allowed_protocols\u0026#39; =\u0026gt; array(\u0026#39;http\u0026#39;) ) ) ) "
},
{
"uri": "https://piklist.github.io/docs/getting-started/writing-a-plugin-for-piklist/",
"title": "Writing a plugin for Piklist",
"tags": [],
"description": "Writing a plugin to take advantage of Piklist is very simple. The only additional step is registering your plugin with Piklist, otherwise, this is just like writing a regular WordPress plugin. Like all plugins, Piklist plugins also live in your wp-content/plugins/ folder.",
"content": "Writing a plugin to take advantage of Piklist is very simple. The only additional step is registering your plugin with Piklist, otherwise, this is just like writing a regular WordPress plugin. Like all plugins, Piklist plugins also live in your wp-content/plugins/ folder.\nRegistering your plugin with Piklist When writing WordPress plugins that rely on other plugins, you usually have to use hooks and filters… but not with Piklist. We’ve simplified the process for you.\n First create a folder to hold your plugin. The folder name can be anything you want… this is the same as any other plugin you would write.\n Then create your main plugin file, and make sure it’s the same name as your folder. So if your plugin is in the folder /my-cool-plugin/, then the main file should be named my-cool-plugin.php, as suggested on WordPress.org.\n Now, add the standard WordPress file headers to the top… this is also the same as any other plugin you would write.\n Now, here’s how you tell Piklist your plugin exists. Add one more line to the file header you just created: Plugin Type: Piklist. That’s it! Your new plugin header would look something like this:\n \u0026lt;?php /* Plugin Name: Name Of The Plugin Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates Description: A brief description of the Plugin. Version: The Plugin's Version Number, e.g.: 1.0 Author: Name Of The Plugin Author Author URI: http://URI_Of_The_Plugin_Author Plugin Type: Piklist License: A \u0026quot;Slug\u0026quot; license name e.g. GPL2 */ ?\u0026gt; As long as you have Piklist activated on your site, this plugin will now run properly.\nNow you just need to create the proper folder structure so you can start creating fields and more.\nCreating plugins has never been easier!\nAdding your plugin to WordPress.org Let your users know Piklist is powering your plugin:\n Add a “Powered by Piklist” logo to your plugin banner. You can download it here \u0026gt;\n Add “Piklist” as a tag in your readme.txt file.\n Add the following information to your readme.txt file. This code is formatted for markup, which WordPress.org uses to parse your readme.txt file. The spaces after the second line are intentional and create a line break.\n \u0026gt; #### Powered by Piklist \u0026gt; WordPress Helpers requires the Piklist framework. \u0026gt; \u0026lt;a href=\u0026quot;http://wordpress.org/extend/plugins/piklist/\u0026quot;\u0026gt;You can download and install Piklist for free.\u0026lt;/a\u0026gt; "
},
{
"uri": "https://piklist.github.io/docs/getting-started/piklist-add-ons/",
"title": "Piklist Add-ons",
"tags": [],
"description": "Piklist Add-ons allow you to put a plugin in your theme or plugin.",
"content": "Piklist Add-ons allow you to put a plugin in your theme or Piklist plugin. This allows you to package full featured plugins that are only available when your theme or plugin is active.\nA good example of this is the Piklist Demos that come with Piklist itself.\nCreating a Piklist add-on is not much different than creating a Piklist plugin. The difference is, the plugin lives in the /add-ons folder in your theme or plugin.\n Review the Piklist folder structure and create an /add-ons folder in the appropriate location.\n Add another folder to hold your plugin. It should look like: /add-ons/my-plugin.\n Now write your plugin as you normally would.\n When your theme or plugin is activated, you will find your add-on, in the \u0026ldquo;Piklist \u0026gt; Add-ons\u0026rdquo; menu.\n"
},
{
"uri": "https://piklist.github.io/docs/fields/validating-fields/",
"title": "Validating Fields",
"tags": [],
"description": "When writing field code, whether with Piklist or not, you should be extra cautious of how you handle data coming into WordPress and how it’s presented to the end user. Piklist makes validating your data easy with the `validate` parameter.",
"content": "When writing field code, whether with Piklist or not, you should be extra cautious of how you handle data coming into WordPress and how it’s presented to the end user. Piklist makes validating your data easy with the validate parameter.\nYou can also create your own custom validation rules using the piklist_validation_rules filter.\nChoose the appropriate type of validation for each of your fields.\nemail Verifies that the input is in the proper format for an email address.\nUses the standard WordPress function is_email\n\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;email\u0026#39; ) ) email_domain Verifies that the input is a valid email domain.\nUses the standard PHP function checkdnsrr\n\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;email_domain\u0026#39; ) ) email_exists Checks that the entered email is not already registered to another user.\nUses the standard WordPress function email_exists\n\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;email_exists\u0026#39; ) ) file_exists Verifies that the file path entered leads to an actual file.\n\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;file_exists\u0026#39; ) ) hex_color Verifies that the data entered is a valid hex color.\n\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;hex_color\u0026#39; ) ) image Verifies that the file path entered leads to an image file.\nUses the standard PHP function exif_imagetype\n\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;image\u0026#39; ) ) ip_address Verifies that the data entered is a valid IP Address.\n\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;ip_address\u0026#39; ) ) limit Verifies that the number of items are within the defined limit.\nOptions min The minimum allowed value. default: 1\nmax The maximum allowed value default: infinite\ncount Determines what you want to count: words, characters, files, images, add-more\u0026rsquo;s\nvalues: words, characters\ndefault: false (files, images, add-more\u0026rsquo;s)\n,\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;limit\u0026#39; ,\u0026#39;options\u0026#39; =\u0026gt; array( \u0026#39;min\u0026#39; =\u0026gt; 2 ,\u0026#39;max\u0026#39; =\u0026gt; 2 ) ) ) ,\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;limit\u0026#39; ,\u0026#39;options\u0026#39; =\u0026gt; array( \u0026#39;min\u0026#39; =\u0026gt; 2 ,\u0026#39;max\u0026#39; =\u0026gt; 6 ,\u0026#39;count\u0026#39; =\u0026gt; \u0026#39;characters\u0026#39; ) ) ) match Checks to see if two fields match.\nOptions field The field name to match\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;password\u0026#39; ,\u0026#39;scope\u0026#39; =\u0026gt; \u0026#39;user\u0026#39; ,\u0026#39;field\u0026#39; =\u0026gt; \u0026#39;user_pass_repeat\u0026#39; ,\u0026#39;label\u0026#39; =\u0026gt; \u0026#39;Repeat New Password\u0026#39; ,\u0026#39;value\u0026#39; =\u0026gt; false // Setting to false forces no value to show in form. ,\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;match\u0026#39; ,\u0026#39;options\u0026#39; =\u0026gt; array( \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;user_pass\u0026#39; // does this match the field user_pass_repeat ) ) ) )); range Verifies that the data entered is within the defined range.\nOptions min The minimum allowed value. default: 1\nmax The maximum allowed value default: 10\n,\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;range\u0026#39; ,\u0026#39;options\u0026#39; =\u0026gt; array( \u0026#39;min\u0026#39; =\u0026gt; 2 ,\u0026#39;max\u0026#39; =\u0026gt; 8 ) ) ) safe_text Verifies that the data entered is alphanumeric.\n,\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;safe_text\u0026#39; ) ) url Verifies that the data entered is a valid URL.\n,\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;url\u0026#39; ) ) username_exists Checks that the entered username does not already exist.\nUses the standard WordPress function username_exists\n,\u0026#39;validate\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;username_exists\u0026#39; ) ) "
},
{
"uri": "https://piklist.github.io/docs/",
"title": "",
"tags": [],
"description": "Official documentation for Piklist, the most powerful framework available for WordPress.",
"content": "Piklist Documentation Getting Started FAQS With Piklist you can create and enhance almost every part of WordPress. Admin Notices Dismissable or standard admin notices that can be on every admin page, or just specific ones.\n Admin Pages Create \"About\" pages and more, with customizable forms.\n Dashboard Widgets Easy dashboard widgets for Multisite or Single site Custom Fields The simplest, most powerful way to create custom fields in WordPress Frontend Forms Powerful forms that can do anything you can imagine. Help Tabs Easily add WordPress help tabs to any page. Media Library Totally customize your Media Library pages. Pointers Create step-by-step tutorials in the admin. Post Types Register Post Types with Piklist and add power to your post types. Settings The simplest way to add settings pages in WordPress. Shortcodes Piklist automatically creates a UI for your shortcodes. Taxonomies Register Taxonomies with Piklist and add power to your terms. Update Scripts Let Piklist handle update scripts for your plugin or theme. Users Totally customize the user screens. Widgets Easily add widgets to your plugin or theme. Workflow Tabs Break up any page with an advanced tab system. "
},
{
"uri": "https://piklist.github.io/docs/fields/create-your-own-fields/",
"title": "Create your own field",
"tags": [],
"description": "With Piklist, you can easily create your own fields to use in your projects.",
"content": "With Piklist, you can easily create your own fields to use in your projects.\n To start, you should have a /parts folder in your theme or plugin to put Piklist parts files. Add a subfolder called /fields/. The structure should look like /parts/fields/. Create a file in the /fields/ folder. Any files in this folder can become fields automatically registered with Piklist. The name of your file is important since it will become the name of your field. For demonstration purposes we’ll create our own checkbox field and call it my-checkbox, so the file name is my-checkbox.php. Depending on the type of field you want to create, you may want to copy/paste from an existing Piklist field. For this demo, we are going to open the default Piklist checkbox file, piklist/parts/fields/checkbox.php, copy everything and paste it into my-checkbox.php. Make any changes to this field you like, and you’re done! Usage When using your new checkbox, use the type my-checkbox. It should look like this:\npiklist('field', array( 'type' =\u0026gt; 'my-checkbox', // custom field type 'field' =\u0026gt; 'custom-checkbox', 'label' =\u0026gt; 'Custom Select Field', 'choices' =\u0026gt; array( 'first' =\u0026gt; 'First Choice', 'second' =\u0026gt; 'Second Choice', 'third' =\u0026gt; 'Third Choice' ) )); "
},
{
"uri": "https://piklist.github.io/docs/getting-started/piklist-checker/",
"title": "Piklist checker",
"tags": [],
"description": "Use the Piklist checker when creating plugins that require Piklist. The Piklist Checker makes it easy for you to notify users from your plugin or theme when Piklist is not active. Since your plugin or theme requires Piklist, not having Piklist installed and activated would provide an unpleasant user experience. Piklist Checker is designed to alleviate that.",
"content": "Use the Piklist checker when creating plugins that require Piklist. The Piklist Checker makes it easy for you to notify users from your plugin or theme when Piklist is not active. Since your plugin or theme requires Piklist, not having Piklist installed and activated would provide an unpleasant user experience. Piklist Checker is designed to alleviate that.\nIf the user attempts to activate a Piklist plugin or theme, without activating Piklist first, they will get a message notifying them the plugin was deactivated and instructions on how to get Piklist.\nUsage Piklist checker is designed to be easy to include in your plugin or theme.\nInclude the Piklist Checker file in your Piklist plugin or theme. You can always get the most up-to-date version of Piklist Checker at WordPress.org.\nPlugin Add the following to your plugin. Notice the checker code is wrapped in a function that hooks to the init action. Theme If you’re using Piklist in your theme, this code should go in the functions.php file. Notice the added parameter after __FILE__: Example You can find an example of implementing the Piklist Checker in the WordPress Helpers plugin.\n"
},
{
"uri": "https://piklist.github.io/docs/admin-notices/",
"title": "Admin Notices",
"tags": [],
"description": "Creating Admin Notices with Piklist is very easy, and can be done without writing any PHP.",
"content": "/parts/notices/ Creating Admin Notices with Piklist is very easy, and can be done without writing any PHP.\n Decide whether you are going to include your notice in a plugin or theme. Create a notices/ folder in your parts/ folder (e.g. /parts/notices/). Now, create a php file in your notices folder. This file will hold your notice code. At the top of the file, add the following comment block which tells Piklist this is an “updated” type notice, and can be dismissible by the user. \u0026lt;?php /* Notice Type: updated Dismiss: true */ ?\u0026gt; \u0026lt;p\u0026gt;This is my notice\u0026lt;/p\u0026gt; View Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/admin-pages/",
"title": "Admin Pages",
"tags": [],
"description": "With Piklist you can easily create Admin pages to display HTML, embed shortcodes, insert a Piklist form, and create other types of pages.",
"content": "/parts/admin-pages/ With Piklist you can easily create Admin pages to display HTML, embed shortcodes, insert a Piklist form, and create other types of pages.\n\u0026lt;?php /* Page: piklist */ ?\u0026gt; \u0026lt;div class=\u0026quot;wrap about-wrap\u0026quot;\u0026gt; \u0026lt;h1\u0026gt;\u0026lt;?php echo __('Welcome to Piklist','piklist'); ?\u0026gt;\u0026lt;/h1\u0026gt; \u0026lt;/div\u0026gt; View Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/dashboard-widgets/",
"title": "Dashboard Widgets",
"tags": [],
"description": "With Piklist you can easily create Dashboard Widgets for a standard WordPress site or for Network Dashboards in multisite.",
"content": "/parts/dashboard/ With Piklist you can easily create Dashboard Widgets for a standard WordPress site or for Network Dashboards in multisite.\n\u0026lt;?php /* Title: My Dashboard Widget Capability: manage_options */ _e('Welcome to my dashboard widget', 'piklist'); View Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/fields/",
"title": "Fields",
"tags": [],
"description": "Piklist fields are incredibly powerful and easy to use.",
"content": "Fields Piklist fields are incredibly powerful and easy to use.\nField Types\n Sanitizing Fields\n Validating Fields\n Create your own field\n Field Parameters\n Field Tutorials "
},
{
"uri": "https://piklist.github.io/docs/forms/",
"title": "Forms",
"tags": [],
"description": "With Piklist you can easily create forms to use on the front of your site, or in the admin. You can create as many files as you like and place them in this folder. Each file will render one form.",
"content": "/parts/forms/ With Piklist you can easily create forms to use on the front of your site, or in the admin. You can create as many files as you like and place them in this folder. Each file will render one form.\n\u0026lt;?php /* Title: Post Submit Method: post Message: Post Saved Logged in: true */ // Where to save this form piklist('field', array( 'type' =\u0026gt; 'hidden' ,'scope' =\u0026gt; 'post' ,'field' =\u0026gt; 'post_type' ,'value' =\u0026gt; 'post' )); piklist('field', array( 'type' =\u0026gt; 'text' ,'scope' =\u0026gt; 'post' ,'field' =\u0026gt; 'post_title' ,'label' =\u0026gt; __('Title', 'piklist') ,'attributes' =\u0026gt; array( 'wrapper_class' =\u0026gt; 'post_title' ,'style' =\u0026gt; 'width: 100%' ) )); piklist('field', array( 'type' =\u0026gt; 'text' ,'scope' =\u0026gt; 'post' ,'field' =\u0026gt; 'post_content' ,'label' =\u0026gt; __('Content', 'piklist') ,'attributes' =\u0026gt; array( 'wrapper_class' =\u0026gt; 'post_content' ,'style' =\u0026gt; 'width: 100%' ) )); piklist('field', array( 'type' =\u0026gt; 'hidden' ,'scope' =\u0026gt; 'post' ,'field' =\u0026gt; 'post_status' ,'value' =\u0026gt; 'pending' )); // Submit button piklist('field', array( 'type' =\u0026gt; 'submit' ,'field' =\u0026gt; 'submit' ,'value' =\u0026gt; 'Submit' )); View Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/help/",
"title": "Help",
"tags": [],
"description": "With Piklist you can easily create Contextual Help menus.",
"content": "/parts/help/ With Piklist you can easily create Contextual Help menus.\nYou can create as many files as you like and place them in this folder. Each file will render one Help Tab.\n\u0026lt;?php /* Title: Post Help Capability: manage_options Page: post.php */ ?\u0026gt; \u0026lt;p\u0026gt; \u0026lt;?php _e('Here is some help, 'piklist');?\u0026gt; \u0026lt;/p\u0026gt; View Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/media/",
"title": "Media",
"tags": [],
"description": "With Piklist you can easily create Media meta-boxes in the admin. You can create as many files as you like and place them in this folder. Each file will render one meta-box.",
"content": "/parts/media/ With Piklist you can easily create Media meta-boxes in the admin. You can create as many files as you like and place them in this folder. Each file will render one meta-box.\n\u0026lt;?php /* Title: Sample Media Fields */ piklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'sample_text' ,'label' =\u0026gt; __('Text', 'piklist') ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'regular-text' ) )); View Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/posts-meta-boxes/",
"title": "Post Types / Meta-boxes",
"tags": [],
"description": "With Piklist you can easily create meta-boxes for any Post Types… built-in WordPress, Post Types you created, or Post Types another theme or plugin created.",
"content": "/parts/meta-boxes/ With Piklist you can easily create meta-boxes for any Post Types… built-in WordPress, Post Types you created, or Post Types another theme or plugin created.\nYou can create as many files as you like and place them in this folder. Each file will render one meta-box.\nView Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/pointers/",
"title": "Pointers",
"tags": [],
"description": "With Piklist you can easily create Pointers in WordPress.",
"content": "/parts/pointers/ With Piklist you can easily create Pointers in WordPress.\nYou can create as many files as you like and place them in this folder. Each file will render one pointer.\nView Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/settings/",
"title": "Settings",
"tags": [],
"description": "A Settings Page is made up of Settings Sections. With Piklist you can easily create these sections.",
"content": "/parts/settings/ A Settings Page is made up of Settings Sections. With Piklist you can easily create these sections.\nYou can create as many files as you like and place them in this folder. Each file will render one section.\nView Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/shortcodes/",
"title": "Shortcodes",
"tags": [],
"description": "With Piklist you can easily create Shortcodes.",
"content": "/parts/shortcodes/ With Piklist you can easily create Shortcodes.\nShortcodes are made up of two files:\n Form file Output file Form file Everything in this file will display a form in the admin. Piklist automatically creates a form for every shortcode you create with it.\nThe format of this file is: widgetname-form.php (i.e. example-form.php)\nOutput file Everything in this file will display on the frontend. It can be as simple as standard HTML or a MailChimp form. Or it can be pulled from the Forms File.\nThe format of this file is: widgetname.php (i.e. example.php)\nView Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/taxonomies-terms/",
"title": "Taxonomies / Terms",
"tags": [],
"description": "With Piklist you can easily create term meta sections.",
"content": "/parts/terms/ With Piklist you can easily create term meta sections.\nYou can create as many files as you like and place them in this folder. Each file will render one section.\nView Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/updates/",
"title": "Update Scripts",
"tags": [],
"description": "If your plugin needs an update procedure, Piklist makes it quite easy. First create a php file, and drop it in the updates folder. The file name should be the current version of your plugin. So, if the update procedure is for version 2.0 of your plugin, then the file name should be 2.0.php.",
"content": "/parts/updates/ If your plugin needs an update procedure, Piklist makes it quite easy. First create a php file, and drop it in the updates folder. The file name should be the current version of your plugin. So, if the update procedure is for version 2.0 of your plugin, then the file name should be 2.0.php.\nThen write your update procedure.\nView Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/users/",
"title": "Users",
"tags": [],
"description": "With Piklist you can easily create user meta sections.",
"content": "/parts/users/ With Piklist you can easily create user meta sections.\nYou can create as many files as you like and place them in this folder. Each file will render one user meta section.\nView Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/widgets/",
"title": "Widgets",
"tags": [],
"description": "With Piklist you can easily create Widgets.",
"content": "/parts/widgets/ With Piklist you can easily create Widgets.\nWidgets are made up of two files:\n Output file (This is the only required file) Form file (Not required) Output file This is the only required file for widgets. Everything in this file will display on the frontend. It can be as simple as standard HTML or a MailChimp form. Or it can be pulled from the Forms File.\nThe format of this file is: widget-name.php (i.e. example.php)\nForm file This file holds the fields that will be filled in on the Widget page in the WordPress admin.\nThe format of this file is: widget-name-form.php (i.e. example-form.php)\nView Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/workflows/",
"title": "Workflow Tabs",
"tags": [],
"description": "Piklist Workflow Tabs allow you to add a tabbed system on Post and User. Additionally, you can add almost anything you want to each tab.",
"content": "/parts/workflows/ Piklist Workflow Tabs allow you to add a tabbed system on Post and User. Additionally, you can add almost anything you want to each tab.\nYou can create as many files as you like and place them in this folder. Each file will render one workflow tab.\nView Tutorials → "
},
{
"uri": "https://piklist.github.io/docs/faq/parse-error-syntax-error-unexpected-t_function/",
"title": "Parse error: syntax error, unexpected T_FUNCTION",
"tags": [],
"description": "An error caused by older versions of PHP.",
"content": "If you’re getting this error, you are running an older version of PHP on your server.\nPiklist, like WordPress, recommends PHP v5.6 or higher.\nPlease contact your host and ask them to upgrade you.\n"
},
{
"uri": "https://piklist.github.io/docs/folder-structure/",
"title": "Folder Structure",
"tags": [],
"description": "Customizing with Piklist is as easy as creating the proper folder structure in your theme or plugin, and placing files in those folders.",
"content": "Customizing with Piklist is as easy as creating the proper folder structure in your theme or plugin, and placing files in those folders.\nTo help keep your code organized, Piklist uses a pre-defined folder/file structure that makes it easy for you to add functionality to your site.\nPiklist utilizes a folder for each major section of WordPress. You create these folders in your theme or plugin and place the appropriate files in them. Piklist will automatically load these files correctly.\nFolder Structure for your theme If you want to use your theme for your Piklist files, open your theme’s main folder and add a folder called “piklist”. Inside that folder add another called “parts” and then add any Piklist folders you will need. Your folder structure should look like this:\n/theme-folder /piklist /add-ons /parts /admin-pages (Do not use for settings pages) /dashboard /help /media /meta-boxes /notices /pointers /settings /terms /updates /users /widgets /workflows Folder Structure for your plugin You can also create a Piklist plugin if you want. The folder structure is slightly different than the one for a theme. Open your plugin’s main folder and add a “parts” folder. In that folder add any folders you will need. Your folder structure should look like this:\n/plugin-folder /add-ons /parts /admin-pages (Do not use for settings pages) /dashboard /help /media /meta-boxes /notices /pointers /settings /terms /updates /users /widgets /workflows "
},
{
"uri": "https://piklist.github.io/docs/actions-filters/",
"title": "Actions and Filters",
"tags": [],
"description": "Piklist Actions and Filters",
"content": "Piklist includes tons of actions and filters.\nFilters\nPiklist Filters\n piklist_admin_pages\nThe piklist_admin_pages filter lets you register your custom Admin Pages through Piklist. This gives you access to additional functionality that Piklist offers.\n piklist_empty_post_title\nLet’s you programmatically set the post title when adding a new post (post type).\n piklist_part_process\nThe `piklist_part_process` filter is used to filter the parts (e.g. meta-boxes, settings, etc.) before they are saved. This allows you to modify or remove parts before they’re processed.\n piklist_part_process-{$folder}\nThe `piklist_part_process-{$folder}` filter is used to filter the parts (e.g. meta-boxes, settings, etc.) before they are saved. This allows you to modify or remove parts before they’re processed.\n piklist_post_types\nThe piklist_post_types filter lets you register your custom Post Types through Piklist. This gives you access to additional functionality that Piklist offers.\n piklist_pre_update_option\nThe piklist_pre_update_option filter is used to filter the settings input before they are saved\n piklist_pre_update_option_$setting\nThe piklist_pre_update_option_$setting filter is used to filter the settings input before they are saved\n piklist_sanitization_rules\nAdd your own rules to sanitize field data.\n piklist_taxonomies\nExtends the standard WordPress function register_taxonomy with additional features and parameters.\n piklist_validation_rules\nAdd your own rules to validate field data.\n piklist_parts_process-{$folder}\nSignals that parts are in process.\n piklist_parts_processed-{$folder}\nSignals that parts have been processed.\n "
},
{
"uri": "https://piklist.github.io/docs/comment-block-parameters/",
"title": "Comment Block Parameters",
"tags": [],
"description": "This is a full list of available parameters for Piklist comment blocks.",
"content": "This is a full list of available parameters for Piklist comment blocks. Not all parameters work with all Piklist parts (parts/ folders).\nAction Input: string Returns: string Align How the pointer should be aligned on this edge, relative to the target.\nPiklist Parts: pointers\n Input: string Returns: string Values: top, bottom, left, right, middle Anchor ID Input: string Returns: string Capability User capability that can view this group of fields. This is not the “minimum” capability, this is the actual capability. Do not include if you wish to allow all users to view. ** Do not use with “role”. Use one or the other\nPiklist Parts: all\n Input: comma-delimited Returns: array Default: Whatever is set in register post type Examples: Capability: edit_posts Capability: edit_posts, edit_others_posts Class Input: comma-delimited Returns: comma-delimited Clear When set to true, all meta-boxes that have been registered by WordPress or other plugins will be removed. This allows you to build your Workflow views exactly the way you want them.\nPiklist Parts: workflows\n Input: boolean Default: false Collapse If set to true, this meta-box will be collapsed by default.\nPiklist Parts: meta-boxes\n Input: boolean Returns: boolean Default: false Context The part of the page where you want this group of fields to show.\nPiklist Parts: meta-boxes\n Input: string Returns: string Values: normal, advanced, side (Any valid value from add_meta_box()) Default: advanced Example:\ncontext: normal Default Input: boolean Returns: boolean Description A description of this section. This field doesn’t do anything except add a description for you.\nPiklist Parts: all\n Input: string Returns: string Disable Input: boolean Returns: boolean Edge Which edge should be adjacent to the target.\nPiklist Parts: pointers\n Input: string Returns: string Values: left, right, top, bottom Editor Add a button to the tinymce editor that will run your shortcode. The icon used is set by the [icon] (#icon) parameter\nPiklist Parts: shortcodes\n Input: boolean Default: false Extend The div# to extend.\n Input: string Returns: string Extend Method The type of extending you would like to do. Choose one:\n before\n after\n replace\n remove\n Input: string\n Returns: string\n Filter Input: boolean Returns: boolean Flow Input: comma-delimited Returns: array Flow page Input: comma-delimited Returns: array Header Input: boolean Returns: boolean Height Input: numeric Returns: numeric Icon Name of the dashicon to represent this shortcode.\nPiklist Parts: shortcodes\n Input: string. Any valid Dashicon Example:\nicon: dashicons-editor-quote ID Display this group of fields for this object ID.\nPiklist Parts: meta-boxes, terms, users, media, notices, workflows\n Input: comma-delimited Returns: array Example:\nid: 2 id: 2, 4 Inline Display this shortcode inline.\nPiklist Parts: shortcodes\n Input: boolean Default: false (block) Example:\ninline: true Lock Locking the meta-box stops the user from being able to drag it around the edit screen.\nPiklist Parts: meta-boxes\n Input: boolean Returns: boolean Default: false Example:\nlock: true Logged in Whether to show to logged in users or not.\nPiklist Parts: all\n Input: boolean Returns: boolean Default: true Example:\nlogged_in: false Message The message to show after a successful submission of a form.\nPiklist Parts: forms\n Input: string Returns: string Example:\nmessage: Thank you for your message. We will get back to you shortly. Meta box If set to false, the default box box \u0026ldquo;look\u0026rdquo; will be removed.\nPiklist Parts: forms\n Input: boolean Returns: boolean Default: true Example:\nMeta box: false Method The HTTP method used for this form.\nPiklist Parts: forms\n Input: string Returns: string Values: get, post Default: Post Example:\nmethod: get Name The name of the part.\nPiklist Parts: all\n Input: string Example:\nname: My Shortcode name: Theme Options Network Show this item in the network settings of a multisite install.\nPiklist Parts: dashboard\n Input: boolean Returns: boolean Example:\nnetwork: true New Show the fields in this file when creating a new term.\nPiklist Parts: term\n Input: boolean Returns: boolean Default: false Example:\nnew: true Notice ID ID of an admin notice.\nPiklist Parts: notices\n Input: string Returns: string Example:\nNotice ID: plugin-intro Notice Type ID of an admin notice.\nPiklist Parts: notices\n Input: string Returns: string Values: info, error, warning Example:\nNotice Type: info Order The sort order of this group of fields. Allows for creating an absolute order of field groups. NOTE: If the \u0026ldquo;lock\u0026rdquo; attribute is not set, or set to \u0026ldquo;false\u0026rdquo;, then the order you set is the default.\nFor meta-boxes, this is within the context and priority. The user can still drag and drop the meta-boxes and take them out of your designated order.\nPiklist Parts: meta-boxes, terms, users, workflows, media\n Input: numeric Returns: numeric Example:\norder: 4 Page What admin page will display this data. NOTE: To display on a settings page, use the menu_slug.\nPiklist Parts: meta-boxes, terms, users, workflows, notices, media\n Input: comma-delimited Returns: array Examples:\nPage: post.php, post-new.php, post-edit.php Page: profile.php, user-edit.php Page: edit-tags.php, term.php Page: my_settings_menu_slug Pointer ID ID of a pointer\nPiklist Parts: pointers\n Input: string Returns: string Example:\nPointer ID: plugin-settings Position The position of your workflow tabs\nPiklist Parts: workflows\n Input: string Returns: string Values: header, body, title, editor Example:\nPosition: body Post Type The Post Type or a comma-delimited list of Post Types that will display this meta-box.\nPiklist Parts: meta-boxes\n Input: comma-delimited Returns: array Values: any registered post type Example:\nPost Type: post, page, custom_post_type Preview Show preview in the admin.\n Input: boolean Example:\nPreview: false Priority The priority within the context where the boxes should show. Works with the context parameter.\nPiklist Parts: meta-boxes\n Input: string Returns: string Values: high, core, default, low (Any valid value from add_meta_box()) Default: default Example:\nPriority: core Redirect Piklist Parts: forms\n Input: string Returns: string Examples:\nRedirect: / Redirect: /thank-you Redirect: https://another-site.com Role User role that can view this group of fields. This is not the \u0026ldquo;minimum\u0026rdquo; role, this is the actual role . Do not include if you wish to allow all users to view. ** Do not use with \u0026ldquo;capability\u0026rdquo;. Use one or the other.\nPiklist Parts: all\n Input: comma-delimited Returns: array Values: Any user role Examples:\nRole: administrator Role: administrator, editor, custom-role Setting The setting this section belongs to, as defined when you initially register the Settings Page.\nPiklist Parts: settings\n Input: string Returns: string Values: Any registered setting Examples:\nSetting: my_settings Shortcode The name of the shortcode. Spaces are not allowed.\nPiklist Parts: shortcodes\n Input: string Returns: string Examples:\nShortcode: my_shortcode Sidebar Display the content in this file in the Help Tab Sidebar. Do not create a tab for it.\nPiklist Parts: help\n Input: boolean Returns: boolean Examples:\nSidebar: true Slug Available in Piklist Beta only Display this group of fields for this object slug.\nPiklist Parts: meta-boxes, terms, users, media, notices, workflows\n Input: comma-delimited Returns: array When targeting a post, term or media item, use that items slug. When targeting a user, use their user ID.\nExample:\nslug: my-page slug: my-page, my-term, my-media, a-user-id Standalone By default, Piklist takes all widgets created within a plugin or theme, and groups them as one widget. If you want your widget to not be part of a group, like the WordPress default, set this parameter to true.\nPiklist Parts: help\n Input: boolean Returns: boolean Default: false Examples:\nStandalone: true Status List of post statuses that will show this meta-box. Custom post statuses are allowed.\nPiklist Parts: meta-boxes\n Input: comma-delimited Returns: array Examples:\nStatus: my_custom_status Status: my_custom_status, published Sub Tab If a Workflow and a Tab have already been defined, use this parameter to assign this field group to a sub-tab of a Tab.\nPiklist Parts: meta-boxes, terms, users, settings, media\n Input: comma-delimited Returns: array Examples:\nSub Tab: basic Sub Tab: basic, tab one Tab If a Workflow has been defined, use this parameter to assign this field group to a specific Tab.\nPiklist Parts: meta-boxes, terms, users, settings, media\n Input: comma-delimited Returns: array Examples:\nTab: General Tab: General, Advanced Tags Input: comma-delimited Returns: comma-delimited Taxonomy The Taxonomy or a comma-delimited list of Taxonomies that will display this meta-box.\nPiklist Parts: terms\n Input: comma-delimited Returns: array Values: any registered taxonomy Example:\nTaxonomy: category, tag Taxonomy: my_taxonomy Template The file name of the Page Template you want this meta-box to display, without “.php”. The page must be saved with this page template to work. If the file is in a directory, that directory must be included.\nYou must save the page before this parameter will work.\nPiklist Parts: meta-boxes\n Input: string Returns: string Values: any registered taxonomy Example:\nTemplate: my-template Template: page-templates/my-template Template: default Title Title of the section.\nPiklist Parts: all\n Input: string Returns: string Example:\nTitle: Theme Settings Title: User Options Type Input: string Width The width of the widget UI in the admin\nPiklist Parts: widgets\n Input: numeric Returns: numeric Example:\nWidth: 500 Width: 720 "
},
{
"uri": "https://piklist.github.io/docs/faq/",
"title": "FAQs",
"tags": [],
"description": "Frequently asked questions",
"content": "What is Piklist\nA brief explanation of Piklist\n How do I include Piklist in my plugin or theme?\nUsing Piklist with your plugin or theme.\n Why aren’t my fields saving?\nThe most common reason for fields is a conflict with the WordPress “custom fields” meta box.\n Is there a limit on the number of Piklist fields?\nHow to fix field limit issues.\n Update script not running\nFix update script issues.\n Parse error: syntax error, unexpected T_FUNCTION\nAn error caused by older versions of PHP.\n "
},
{
"uri": "https://piklist.github.io/docs/tutorials/",
"title": "Tutorials",
"tags": [],
"description": "Piklist Tutorials",
"content": "We\u0026rsquo;ve put together some tutorials on specific examples. Enjoy!\nAdmin Notices\n Building your first Admin Notice\n Admin Pages\n Building a simple Admin Page\n Dashboard Widgets\n Create a Dashboard Widget to show an RSS Feed.\n Fields (General)\n Conditionally Show Fields\n Display Menus as a Radio, Checkbox or Select list\n Show Fields by User Capability or Role\n Using \u0026#34;Chosen\u0026#34; for select fields\n Using \u0026#34;Select2\u0026#34; for select fields\n Forms\n Understanding Front End Forms\n Help Tabs\n Creating Help Tabs for WordPress\n Media\n Add fields to Media items\n Pointers\n Building Pointers without code\n Posts / Meta-boxes\n Getting Started with Meta-boxes and Fields\n Add Subtitle field to the Post screen\n Add WYSISYG to your Excerpt Box\n Creating Custom Post Statuses\n Hide Meta Boxes for a Page Template\n Lock Field Values based on Post Status\n Registering Post Types\n Show Metaboxes and Fields by Post Status\n Relationships\n Working with Field Relationships\n Settings\n Building Settings Pages\n Shortcodes\n Getting started with Shortcodes\n Save Shortcode data to database\n Taxonomies / Terms\n Getting Started with Taxonomies and Piklist\n Creating Separate Taxonomies for each User\n Display Taxonomies as Radio, Checkboxes or Select list\n Grouping child taxonomies by their parents\n Updates\n Getting started with updates\n Users\n Display Users as a Radio, Checkbox or Select list\n Widgets\n Easy Widgets\n Workflow Tabs\n Building Your First Workflow\n Adding SubTabs to Workflows\n Placing \u0026#34;Add New Post\u0026#34; in a Workflow\n "
},
{
"uri": "https://piklist.github.io/docs/contribute-to-docs/",
"title": "Contribute to Docs",
"tags": [],
"description": "Piklist Documentation is a community effort. Learn how to contribute here.",
"content": "The Piklist Documentation like Piklist itself is a community effort. The code for the documentation is hosted on Github and can be edited and added to like any other file via a pull request.\nThis can be done 100% in the Github.com UI. However, if you like you can also pull the repository to your local and edit there. This guide reviews using the Github.com UI.\nGetting Started You only need to do these steps once.\nGithub.com account The first step is to make sure you have a Github.com account and you\u0026rsquo;re logged in.\nFork the piklist-documentation repository You need to fork the documentation project so you can have a copy in your own repository. Visit the documentation repository and click on the \u0026ldquo;Fork\u0026rdquo; button in the upper right.\nGithub just copied all the documentation files to your personal Github account.\nEditing an existing page At the bottom of every page in the documentation (including this one) is a red \u0026ldquo;Improve this page\u0026rdquo; button. Clicking that button brings you to the appropriate page on Github, in YOUR account where you can start editing. Make any changes you want. Scroll down to the bottom of the page, add some comments if necessary and click \u0026ldquo;propose file change\u0026rdquo;. Github saves the file and creates a new branch automatically. Click \u0026ldquo;Create pull request\u0026rdquo;. Double check your comments and click \u0026ldquo;Create pull request\u0026rdquo; again. Add a new page Go to the content directory of the documentation on Github. Find the appropriate folder for your new page. Click \u0026ldquo;Create new file\u0026rdquo; Name your file. The name of your file will be the URL for that page so please name it something relevant and SEO friendly. The documenation is written in Markdown, so the file should end in \u0026ldquo;.md\u0026rdquo;. Example: how-to-do-awesome-things-with-piklist.md. Add content to the new file. Use an existing documentation file as a guide. Scroll down to the bottom of the page, add some comments if necessary and click \u0026ldquo;propose file change\u0026rdquo;. Github saves the file and creates a new branch automatically. Click \u0026ldquo;Create pull request\u0026rdquo;. Double check your comments and click \u0026ldquo;Create pull request\u0026rdquo; again. After you submit a Pull Request You can view all pull requests here.\nA member of the Piklist documentation team will review your changes. We may make some changes or ask you some questions before accepting them.\nThank you for making the Piklist documentation better.\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/media/add-fields-to-media/",
"title": "Add fields to Media items",
"tags": [],
"description": "Add fields to Media library items",
"content": "Description Piklist makes it radically easy to add meta-boxes and fields to your media items. In this tutorial, we will create a meta-box that includes three fields, select, text and ColorPicker, for standard posts.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. Each file we add to the the media/ folder will create a metabox on the media edit screen. Each field we include in this file will be part of this metabox. Fairly straightforward. Ok, let’s create our Media metabox file!\nCreate a new file in your /parts/media/ folder: let’s call it media-metabox.php. At the top of the file, we will add a comment block that will control the configuration of the metabox. This comment block is very similar to what you would see in a standard WordPress plugin or theme. Here is the minimum variable required:\n\u0026lt;?php /* Title: My Media Metabox */ This comment block tells Piklist you want to name your Media metabox, “My Media Metabox\u0026quot;. The Piklist comment block for Media metaboxes supports a lot more than just these two variables. You can view the full list in our docs.\nNow we start adding our fields. It’s best practice to make the “field” name all lowercase letters, numbers, and dashes or underscores, with no spaces or special characters if possible (i.e. facebook-page-url). The field label can be anything you want.\nLet’s create our first field, a text box:\npiklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'demo_text' ,'label' =\u0026gt; 'Text Box' ,'description' =\u0026gt; 'Field Description' ,'value' =\u0026gt; 'Default text' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); Since Media items in WordPress are really a Post Type, this data will be saved as post meta.\nNow, let’s create our select field:\npiklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'demo_select' ,'label' =\u0026gt; 'Select Box' ,'description' =\u0026gt; 'Choose from the drop-down.' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) ,'choices' =\u0026gt; array( 'option1' =\u0026gt; 'Option 1' ,'option2' =\u0026gt; 'Option 2' ,'option3' =\u0026gt; 'Option 3' ) )); Notice that this array is very similar to the one used to create the text box. Just two differences:\n type =\u0026gt; select: Tells Piklist that you want to render a select field. The choices array adds your choices. That’s it! Everything else is the same.\nOne more field to go in this tutorial. Let’s create our ColorPicker field. Normally, you would need to add Javascript and CSS to create this field… but not with Piklist!\npiklist('field', array( 'type' =\u0026gt; 'colorpicker' ,'field' =\u0026gt; 'demo_colorpicker' ,'label' =\u0026gt; 'Choose a color' ,'value' =\u0026gt; '#aee029' ,'description' =\u0026gt; 'Click in the box to select a color.' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); Seriously, that’s all you need to create a ColorPicker field. You will notice this is pretty much the same code used to create the text box, except we set ‘type’ =\u0026gt; ‘colorpicker’.\nFull Code Snippet: \u0026lt;?php /* Title: My Media Metabox */ piklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'demo_text' ,'label' =\u0026gt; 'Text Box' ,'description' =\u0026gt; 'Field Description' ,'value' =\u0026gt; 'Default text' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); piklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'demo_select' ,'label' =\u0026gt; 'Select Box' ,'description' =\u0026gt; 'Choose from the drop-down.' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) ,'choices' =\u0026gt; array( 'option1' =\u0026gt; 'Option 1' ,'option2' =\u0026gt; 'Option 2' ,'option3' =\u0026gt; 'Option 3' ) )); piklist('field', array( 'type' =\u0026gt; 'colorpicker' ,'field' =\u0026gt; 'demo_colorpicker' ,'label' =\u0026gt; 'Choose a color' ,'value' =\u0026gt; '#aee029' ,'description' =\u0026gt; 'Click in the box to select a color.' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); Usage Where possible, Piklist uses the default WordPress functions to get things done, and using Post Meta is no different. You can use the get_post_meta() function to pull this data into your theme. Here’s how you would use these fields in your single.php file:\necho get_post_meta($attachment-\u0026gt;ID, 'demo_text', true); echo get_post_meta($attachment-\u0026gt;ID, 'demo_select', true); echo get_post_meta($attachment-\u0026gt;ID, 'demo_colorpicker', true); get_post_meta() takes a second parameter, which can be set as true or false. Set to true if you want only a single row from the database, or false if you want every row it finds that matches the meta name.\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/meta-boxes/add-subtitle-field/",
"title": "Add Subtitle field to the Post screen",
"tags": [],
"description": "Insert a subtitle filed to the Post screen",
"content": " New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. The Piklist folder structure makes it very easy to create Meta-Boxes, Settings Sections, etc, with limited code. Sometimes, however, you may need to insert a field in a specific place. Usually this is tied to a WordPress hook.\nThe Piklist field function, can be used outside the Piklist folder structure, and placed inside a standard function.\nFor this tutorial, we will insert a “Subtitle” field, under the Post Title field. A few things:\n The following code will go into your Theme’s functions.php file, or your plugin file. It does NOT go into the Piklist parts/ directory. To place a field after the Post Title, we are going to use to the standard WordPress hook, edit_form_after_title. This hook allows you to insert information after the Post Title field. The same Piklist field function that we would use in a parts/ folder, we will use in a function instead. Here’s the code:\nfunction my_add_sub_title() { piklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'text' ,'template' =\u0026gt; 'field' // format the field without a label ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'large-text' ,'placeholder' =\u0026gt; 'Enter subtitle here' ) )); } add_action('edit_form_after_title', 'my_add_sub_title'); "
},
{
"uri": "https://piklist.github.io/docs/tutorials/meta-boxes/add-wysisyg-excerpt-box/",
"title": "Add WYSISYG to your Excerpt Box",
"tags": [],
"description": "To add some style to your excerpts, you can easily add a WYSIWYG editor to your excerpt box.",
"content": "Description To add some style to your excerpts, you can easily add a WYSIWYG editor to your excerpt box.\nFirst, remove the default excerpt box Custom post type If you’re registering your own post type, include the supports parameter but don’t include excerpt in the array. This will tell WordPress not to render the excerpt box.\nBuilt in post type Use the standard WordPress function remove_post_type_support, to remove the editor. For example, to remove the editor from Posts, place this in your theme’s functions.php file, or your main plugin file:\nfunction my_remove_post_type_support() { remove_post_type_support('post', 'excerpt'); } add_action('init', 'my_remove_post_type_support', 10); Now, add your own editor with Piklist Create your metabox. Add the excerpt field, and make sure you set the following: 'scope' =\u0026gt; 'post' since WordPress saves this data in the post table. 'field' =\u0026gt; 'post_excerpt' is the field name for the default excerpt field. 'template' =\u0026gt; 'field' Uses the Piklist \u0026ldquo;field-only\u0026rdquo; template with no label. piklist('field', array( 'type' =\u0026gt; 'editor' ,'scope' =\u0026gt; 'post' ,'template' =\u0026gt; 'field' ,'field' =\u0026gt; 'post_excerpt' ,'options' =\u0026gt; array ( 'media_buttons' =\u0026gt; false ,'teeny' =\u0026gt; true ) )); That’s it. Your done.\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/admin-notices/",
"title": "Admin Notices",
"tags": [],
"description": "Tutorials on Admin Notices",
"content": "Tutorials Building your first Admin Notice\nPiklist makes it super easy to create admin notices in WordPress.\n "
},
{
"uri": "https://piklist.github.io/docs/tutorials/admin-pages/",
"title": "Admin Pages",
"tags": [],
"description": "Tutorials on Admin Pages",
"content": "Tutorials Building a simple Admin Page\nPiklist makes it super easy to create admin pages in WordPress.\n "
},
{
"uri": "https://piklist.github.io/docs/about-piklist/benefits-of-using-piklist/",
"title": "Benefits of using Piklist",
"tags": [],
"description": "Piklist makes it super simple to add fields and data to almost every part of WordPress.",
"content": "Piklist makes it super simple to add fields and data to almost every part of WordPress:\n Use minimal code to generate complex fields. Code-based for maximum flexibility. Use the same field code to generate a post-meta field or a settings field or a user field\u0026hellip; Packed with hooks and filters so you can modify almost everything in WordPress. Enterprise level code quality. "
},
{
"uri": "https://piklist.github.io/docs/tutorials/pointers/building-pointers-without-code/",
"title": "Building Pointers without code",
"tags": [],
"description": "Piklist let's you build WordPress pointers without code.",
"content": "Description Piklist let\u0026rsquo;s you build WordPress Pointers without code. No PHP. No Javascript.\nIn this tutorial, we will create a simple WordPress pointer.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. Create a PHP file in your /parts/pointers/ folder. If the folder doesn\u0026rsquo;t exist, then create it. Add the following code to your file: \u0026lt;?php /* Title: WordPress Dashboard Anchor ID: #menu-dashboard Edge: top Align: bottom */ ?\u0026gt; \u0026lt;p\u0026gt;The WordPress dashboard is a great place to get information about your website.\u0026lt;/p\u0026gt; The comment block at the top takes a minimum of four parameters:\n Title: The title of your pointer. Anchor ID: The ID of the item you want to attach the pointer to. This can be a div #, li #, any HTML ID. Edge: Which edge of the pointer (left, right, top, bottom) should be adjacent to the target. Align: How the pointer should be aligned on this edge, relative to the target (top, bottom, left, right, middle). That\u0026rsquo;s it! You have a new pointer.\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/settings/building-settings-pages/",
"title": "Building Settings Pages",
"tags": [],
"description": "Creating WordPress Settings pages with Piklist is as easy as creating any other field type.",
"content": "Creating WordPress Settings pages with Piklist is as easy as creating any other field type. First we register the Settings page, and then we start adding Settings sections. Piklist uses the standard WordPress settings API, plus it adds extra power and ease of use. You can use any Piklist field type on a Settings page, and easily add Tabs as well.\nIn this tutorial, we will create a Settings Page that includes three fields: select, text and colorPicker, with tooltip help.\nRegister your Settings Page Like everything in Piklist, we start with a simple but powerful array. Then we hook it to the proper Piklist function. If you’re creating this settings page in your theme then this code belongs in functions.php. If this is a Settings page for a plugin, then add it to the main file in your plugin, after you register your plugin with Piklist.\nadd_filter('piklist_admin_pages', 'piklist_theme_setting_pages'); function piklist_theme_setting_pages($pages) { $pages[] = array( 'page_title' =\u0026gt; __('Custom Settings') ,'menu_title' =\u0026gt; __('Settings', 'piklist') ,'sub_menu' =\u0026gt; 'themes.php' //Under Appearance menu ,'capability' =\u0026gt; 'manage_options' ,'menu_slug' =\u0026gt; 'custom_settings' ,'setting' =\u0026gt; 'my_theme_settings' ,'menu_icon' =\u0026gt; plugins_url('piklist/parts/img/piklist-icon.png') ,'page_icon' =\u0026gt; plugins_url('piklist/parts/img/piklist-page-icon-32.png') ,'single_line' =\u0026gt; true ,'default_tab' =\u0026gt; 'Basic' ,'save_text' =\u0026gt; 'Save Demo Settings' ); return $pages; } Create a Settings Section Now we need to create the proper folder structure in your theme. Piklist uses this folder structure to automatically help you when building fields. Create a piklist folder, and then a parts subfolder, and then add a settings subfolder. You can see the supported Piklist folder structure here. Each file we add to the the settings folder will create a Settings section on the Settings page. You can have multiple Sections on each Settings page as well. Each field we include in this file will be part of this Section. Fairly straightforward. OK, let’s create our Settings section file!\n Create a new file: let’s call it demo-settings.php. At the top of the file, we will add a comment block that will control the configuration of the Settings section. This comment block is very similar to what you would see in a standard WordPress plugin or theme. Here are the minimum variables required: \u0026lt;?php /* Title: Theme Settings Section Setting: my_theme_settings */ This comment block tells Piklist you want to name your Settings section, “My Demo Settings Section”, and you want to associate this Section with the Settings page that uses the setting “demo-setting”. When you registered your Settings page, earlier in this tutorial, this is the setting you defined. The Piklist comment block for settings supports a lot more than just these two variables. You can view the full list in our docs.\n Now, let’s create our first field, a TEXT BOX: piklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'text' ,'label' =\u0026gt; 'Text Box' ,'description' =\u0026gt; 'Field Description' ,'help' =\u0026gt; 'This is help text.' ,'value' =\u0026gt; 'Default text' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); This simple array will create a TEXT BOX that automatically uses the WordPress settings API to display and save. The 'type' =\u0026gt; 'text' variable tells Piklist what sort of field to render. Also, notice that this is very similar to the way you create fields for metaboxes.\n Now, let’s create our next field, a SELECT FIELD: piklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'select' ,'label' =\u0026gt; 'Select Box' ,'description' =\u0026gt; 'Choose from the drop-down.' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) ,'choices' =\u0026gt; array( 'option1' =\u0026gt; 'Option 1' ,'option2' =\u0026gt; 'Option 2' ,'option3' =\u0026gt; 'Option 3' ) )); Notice that this array is very similar to the one used to create the text box. Just two differences:\n 'type' =\u0026gt; 'select': Tells Piklist that you want to render a select field. The choices array adds your choices. That’s it! Everything else is the same.\n One more field to go in this tutorial. Let’s create our ColorPicker field. Normally, you would need to add Javascript and CSS to create this field… but not with Piklist! piklist('field', array( 'type' =\u0026gt; 'colorpicker' ,'field' =\u0026gt; 'colorpicker' ,'label' =\u0026gt; 'Choose a color' ,'value' =\u0026gt; '#aee029' ,'description' =\u0026gt; 'Click in the box to select a color.' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); Seriously, that’s all you need to create a ColorPicker field. You will notice this is pretty much the same code used to create the text box, except we set 'type' =\u0026gt; 'colorpicker'.\nFull code snippet /* Title: Theme Settings Section Setting: my_theme_settings */ piklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'text' ,'label' =\u0026gt; 'Text Box' ,'description' =\u0026gt; 'Field Description' ,'help' =\u0026gt; 'This is help text.' ,'value' =\u0026gt; 'Default text' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); piklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'select' ,'label' =\u0026gt; 'Select Box' ,'description' =\u0026gt; 'Choose from the drop-down.' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) ,'choices' =\u0026gt; array( 'option1' =\u0026gt; 'Option 1' ,'option2' =\u0026gt; 'Option 2' ,'option3' =\u0026gt; 'Option 3' ) )); piklist('field', array( 'type' =\u0026gt; 'colorpicker' ,'field' =\u0026gt; 'colorpicker' ,'label' =\u0026gt; 'Choose a color' ,'value' =\u0026gt; '#aee029' ,'description' =\u0026gt; 'Click in the box to select a color.' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); Using these fields in a theme: Where possible, Piklist uses the default WordPress functions to get things done, and using Settings is no different. You can use the standard WordPress function get_option to pull this data into your theme. Here’s how you would use these fields in your theme file:\n$theme_options = get_option('my_theme_settings'); $text_field = $theme_options['text']; $select_field = $theme_options['select']; $colorpicker_field = $theme_options['colorpicker']; echo 'This is a text field' . $text_field; "
},
{
"uri": "https://piklist.github.io/docs/categories/",
"title": "Categories",
"tags": [],
"description": "",
"content": ""
},
{
"uri": "https://piklist.github.io/docs/fields/types/checkbox/",
"title": "checkbox Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'checkbox' piklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;checkbox\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;checkbox\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;Checkbox\u0026#39;, \u0026#39;value\u0026#39; =\u0026gt; \u0026#39;third\u0026#39;, // set default value \u0026#39;choices\u0026#39; =\u0026gt; array( \u0026#39;first\u0026#39; =\u0026gt; \u0026#39;First Choice\u0026#39;, ,\u0026#39;second\u0026#39; =\u0026gt; \u0026#39;Second Choice\u0026#39;, ,\u0026#39;third\u0026#39; =\u0026gt; \u0026#39;Third Choice\u0026#39; ) )); "
},
{
"uri": "https://piklist.github.io/docs/fields/types/color/",
"title": "color Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'color' This is an HTML5 field\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;color\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;my_field\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;Color field\u0026#39;, )); "
},
{
"uri": "https://piklist.github.io/docs/fields/types/colorpicker/",
"title": "colorpicker Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'colorpicker' Create a WordPress colorpicker field.\nYou can use Piklist field parameters to customize this field.\npiklist('field', array( 'type' =\u0026gt; 'colorpicker', 'field' =\u0026gt; 'my_color', 'label' =\u0026gt; 'Color Picker' )); "
},
{
"uri": "https://piklist.github.io/docs/tutorials/fields/conditionally-show-fields/",
"title": "Conditionally Show Fields",
"tags": [],
"description": "Piklist makes it easy to show one or more fields, based on the value of another field, and so much more.",
"content": "Description Piklist makes it easy to show one or more fields, based on the value of another field, and so much more. The Piklist conditions parameter is very powerful, and you can see all the options in the documentation.\nIn this tutorial, if the user clicks on the “Yes” radio button to subscribe to our newsletter, we will show an “Email” text field.\n Conditional fields work on almost every page in WordPress. In this tutorial we are going to build these fields for a Post.\n First let’s build a metabox using our base tutorial. You can stop at \u0026ldquo;Adding Fields\u0026rdquo;, since we will be creating our own fields.\n Now, let’s add two fields:\n The Control field will be a radio button The Conditional field will only display if “Yes” is selected in the radio button. Build the Control Field Building the Control field in Piklist is exactly the same as building any other field. There is absolutely nothing different about it. In this case, we are going to build the standard radio field that will ask the user if they want to subscribe to the newsletter:\npiklist('field', array( 'type' =\u0026gt; 'radio' ,'field' =\u0026gt; 'subscribe_to_newsletter' ,'label' =\u0026gt; 'Would you like to subscribe to our newsletter?' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) ,'choices' =\u0026gt; array( 'yes' =\u0026gt; 'Yes' ,'no' =\u0026gt; 'No' ) ,'value' =\u0026gt; 'no' )); Note, that we set value =\u0026gt; 'no'. This sets the default value of the field to “No”, which hides the email box.\nBuild the Conditional Field Let’s start with a standard Piklist text box.\npiklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'email_address' ,'label' =\u0026gt; 'Email Address' ,'description' =\u0026gt; 'Please enter your email address' ) )); Now we are going to add the \u0026ldquo;conditions\u0026rdquo; array:\n,'conditions' =\u0026gt; array( array( 'field' =\u0026gt; 'subscribe_to_newsletter' ,'value' =\u0026gt; 'yes' ) ) This array can actually hold a variety of conditions. In this case, we are saying: If the field “subscribe_to_newsletter” (our Control field name) equals yes, then show this field.\nAll together the conditional field looks like this:\npiklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'email_address' ,'label' =\u0026gt; 'Email Address' ,'description' =\u0026gt; 'Please enter your email address' ,'conditions' =\u0026gt; array( array( 'field' =\u0026gt; 'subscribe_to_newsletter' ,'value' =\u0026gt; 'yes' ) ) )); Full Code Snippet: piklist('field', array( 'type' =\u0026gt; 'radio' ,'field' =\u0026gt; 'subscribe_to_newsletter' ,'label' =\u0026gt; 'Would you like to subscribe to our newsletter?' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) ,'choices' =\u0026gt; array( 'yes' =\u0026gt; 'Yes' ,'no' =\u0026gt; 'No' ) ,'value' =\u0026gt; 'no' )); piklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'email_address' ,'label' =\u0026gt; 'Email Address' ,'description' =\u0026gt; 'Please enter your email address' ,'conditions' =\u0026gt; array( array( 'field' =\u0026gt; 'subscribe_to_newsletter' ,'value' =\u0026gt; 'yes' ) ) )); "
},
{
"uri": "https://piklist.github.io/docs/tutorials/meta-boxes/creating-custom-post-statuses/",
"title": "Creating Custom Post Statuses",
"tags": [],
"description": "Custom Post Statuses are at the heart of any web application built with WordPress, and Piklist makes it easy for you to implement them.",
"content": "Custom Post Statuses are at the heart of any web application built with WordPress, and Piklist makes it easy for you to implement them. No longer are you stuck with draft, pending review and published. You can add whatever post statuses you choose.\nA few important caveats:\n Due to the nature of WordPress, your first post status has to remain “draft”. You can change the label so it displays “New”, or “Howdy”, but the key in the post status array will have to remain draft (we’ll explain more later in the tutorial). Some themes may not display your post if the status is not published, so you may have to modify your theme’s loop to show it. This parameter does not ADD statuses to the Post Type, it removes the default WordPress statuses and REPLACES them. Like most items in Piklist, we will use an array of values to add our Custom Post Statuses. Piklist has a bunch of parameters to use with Custom Post Types, the one we will use is status. Add this to your Custom Post Type you registered with the Piklist filter piklist_post_types:\n'status' =\u0026gt; array( 'draft' =\u0026gt; array( 'label' =\u0026gt; 'New' ) ) This code tells Piklist to rename the draft status to New. Due to the nature of WordPress, your first status must always be draft. We just renamed it to New.\nThe second post status just gets added to this array. The “Request for Estimate” status looks like this:\n'status' =\u0026gt; array( 'draft' =\u0026gt; array( 'label' =\u0026gt; 'New' ) ,'estimate' =\u0026gt; array( 'label' =\u0026gt; 'Request for Estimate' ) You’ve just created post status named “estimate”, with the label “Request for Estimate”.\nJust continue adding your statuses to the array until you’re done. Here’s the full code snippet for creating the Custom Post Type from step 1, and adding in all the post statuses from the image above:\nadd_filter('piklist_post_types', 'demo_post_type'); function demo_post_type($post_types) { $post_types['demo'] = array( 'labels' =\u0026gt; piklist('post_type_labels', 'Demo') ,'title' =\u0026gt; __('Enter a new Demo Title') ,'public' =\u0026gt; true ,'rewrite' =\u0026gt; array( 'slug' =\u0026gt; 'demo' ) ,'supports' =\u0026gt; array( 'author' ,'revisions' ) ,'hide_meta_box' =\u0026gt; array( 'slug' ,'author' ,'revisions' ,'comments' ,'commentstatus' ) ,'status' =\u0026gt; array( 'draft' =\u0026gt; array( 'label' =\u0026gt; 'New' ) ,'shipping-received' =\u0026gt; array( 'label' =\u0026gt; 'Shipping Received' ) ,'inspection-wfa' =\u0026gt; array( 'label' =\u0026gt; 'Inspection: Waiting for Approval' ) ,'inspection' =\u0026gt; array( 'label' =\u0026gt; 'Inspection Approved' ) ,'work-order-pca' =\u0026gt; array( 'label' =\u0026gt; 'Work Order, PCA' ) ,'repair-queue' =\u0026gt; array( 'label' =\u0026gt; 'Repair Queue' ) ,'paint-queue' =\u0026gt; array( 'label' =\u0026gt; 'Paint Queue' ) ,'jbp-paint-queue' =\u0026gt; array( 'label' =\u0026gt; 'JBP Paint Queue' ) ,'shipped' =\u0026gt; array( 'label' =\u0026gt; 'Pending Shipment' ) ,'closed' =\u0026gt; array( 'label' =\u0026gt; 'Closed' ) ) ); return $post_types; } Custom Post Statuses in Piklist take the same parameters as the WordPress function register_post_status. They get passed in an array as seen below:\n,'closed' =\u0026gt; array( 'label' =\u0026gt; 'Closed', 'public' =\u0026gt; true, 'exclude_from_search' =\u0026gt; true, 'show_in_admin_all_list' =\u0026gt; true, 'show_in_admin_status_list' =\u0026gt; true ) "
},
{
"uri": "https://piklist.github.io/docs/tutorials/help/creating-help-tabs-for-wordpress/",
"title": "Creating Help Tabs for WordPress",
"tags": [],
"description": "Creating Help Tabs for WordPress is super easy with Piklist.",
"content": "Description Creating Help Tabs for WordPress is super easy with Piklist.\nIn this example, we\u0026rsquo;ll create some help for your custom Post Type. You should already have a custom Post Type registered and working in WordPress.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. In your parts/help/ folder create a new PHP file to hold your notice code. This file can be named anything you want. Add the following to the top of your file: \u0026lt;?php /* Title: Content Help Page: your_custom_post_type */ ?\u0026gt; This comment block tells Piklist to create a Help tab for the page yourdomain.com/wp-admin/post-new.php?post_type=your_custom_post_type.\n Under this comment block add your help text. This post type is used for a special purpose. Full Snippet \u0026lt;?php /* Title: Content Help Page: your_custom_post_type */ ?\u0026gt; This post type is used for a special purpose. Add a Help Sidebar WordPress also allows for a sidebar in your help.\n Create another PHP file in the same folder. It can be named anything you want. Add this to the top: \u0026lt;?php /* Page: your_custom_post_type Sidebar: true */ ?\u0026gt; This code tells Piklist to create a Help sidebar on the same page as your help.\n Add your sidebar help below it: \u0026lt;p\u0026gt; \u0026lt;h4\u0026gt;Help is just a click away.\u0026lt;/h4\u0026gt; \u0026lt;ol\u0026gt; \u0026lt;li\u0026gt; \u0026lt;a href=\u0026quot;//yoursite.com/contact-us target=\u0026quot;_blank\u0026quot;\u0026gt;Contact us\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt; \u0026lt;li\u0026gt;\u0026lt;a href=\u0026quot;https://google.com/\u0026quot; target=\u0026quot;_blank\u0026quot;\u0026gt;Search Google\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt; \u0026lt;/ol\u0026gt; \u0026lt;/p\u0026gt; You\u0026rsquo;re done!\nFull Snippet \u0026lt;?php /* Page: your_custom_post_type Sidebar: true */ ?\u0026gt; \u0026lt;p\u0026gt; \u0026lt;h4\u0026gt;Help is just a click away.\u0026lt;/h4\u0026gt; \u0026lt;ol\u0026gt; \u0026lt;li\u0026gt; \u0026lt;a href=\u0026quot;//yoursite.com/contact-us target=\u0026quot;_blank\u0026quot;\u0026gt;Contact us\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt; \u0026lt;li\u0026gt;\u0026lt;a href=\u0026quot;https://google.com/\u0026quot; target=\u0026quot;_blank\u0026quot;\u0026gt;Search Google\u0026lt;/a\u0026gt;\u0026lt;/li\u0026gt; \u0026lt;/ol\u0026gt; \u0026lt;/p\u0026gt; "
},
{
"uri": "https://piklist.github.io/docs/tutorials/taxonomies-terms/creating-separate-taxonomies-user/",
"title": "Creating Separate Taxonomies for each User",
"tags": [],
"description": "In this tutorial we’ll provide each logged in user with their own set of private tags.",
"content": "In this tutorial we’ll provide each logged in user with their own set of private tags.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. First, you will need to create your taxonomy using the piklist_taxonomies filter.\nWe’ll assume you will be using a non-hierarchical( like \u0026ldquo;Tags\u0026rdquo; ) taxonomy, and we will name them \u0026lsquo;personal_tags\u0026rsquo;. However, we will do something special with the name. To allow separate taxonomies for each logged in user, we will append their user ID to the end of the taxonomy name. So the user with the ID of 1, will be using \u0026lsquo;personal_tags_1\u0026rsquo;, and the user with the ID of 2, will be using \u0026lsquo;personal_tags_1\u0026rsquo;.\nFull snippet add_filter('piklist_taxonomies', 'my_custom_taxonomies'); function my_custom_taxonomies($taxonomies) { global $current_user; get_currentuserinfo(); // Get logged in user info $taxonomies[] = array( 'post_type' =\u0026gt; array('post') ,'name' =\u0026gt; 'personal_tags_' . $current_user-\u0026gt;ID // Append User ID to taxonomy name ,'configuration' =\u0026gt; array( 'hierarchical' =\u0026gt; false ,'labels' =\u0026gt; piklist('taxonomy_labels', $current_user-\u0026gt;display_name . \u0026quot;'s Tag\u0026quot;) // Append user name to Taxonomy labels ,'show_ui' =\u0026gt; true ,'query_var' =\u0026gt; true ,'rewrite' =\u0026gt; array( 'slug' =\u0026gt; 'personal_tags_' . $current_user-\u0026gt;ID // Append user ID to taxonomy slug ) ,'show_admin_column' =\u0026gt; true ,'comments' =\u0026gt; true ) ); return $taxonomies; } "
},
{
"uri": "https://piklist.github.io/docs/tutorials/dashboard-widgets/",
"title": "Dashboard Widgets",
"tags": [],
"description": "Tutorials on Dashboard Widgets",
"content": "Tutorials Create a Dashboard Widget to show an RSS Feed.\nPiklist makes it super easy to create Dashboard Widgets in WordPress.\n "
},
{
"uri": "https://piklist.github.io/docs/fields/types/date/",
"title": "date Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'date' This is an HTML5 field\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;date\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;my_field\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;Date field\u0026#39;, )); "
},
{
"uri": "https://piklist.github.io/docs/fields/types/datepicker/",
"title": "datepicker Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'datepicker' Create a jQuery datepicker field.\nThis field uses the standard jQuery DatePicker field, and respects the same options. Just define them in the Piklist options array. See examples below.\nYou can use Piklist field parameters to customize this field.\nBasic Datepicker field\npiklist('field', array( 'type' =\u0026gt; 'datepicker', 'field' =\u0026gt; 'my_date_field', 'label' =\u0026gt; 'Date', 'value' =\u0026gt; date('M d, Y', time() + 604800), // set default value 'options' =\u0026gt; array( 'dateFormat' =\u0026gt; 'M d, yy' ) )); Localizing the Datepicker field\nThe datepicker field can be localized by translating these parameters. This example shows the field being translated into French.\npiklist('field', array( 'type' =\u0026gt; 'datepicker', 'field' =\u0026gt; 'my_date_field', 'label' =\u0026gt; 'Date', 'options' =\u0026gt; array( 'closeText'=\u0026gt;'Fermer', 'prevText'=\u0026gt;'Précédent', 'nextText'=\u0026gt;'Suivant', 'currentText'=\u0026gt;'Aujourd\\'hui', 'monthNames'=\u0026gt;['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'], 'monthNamesShort'=\u0026gt;['Janv.','Févr.','Mars','Avril','Mai','Juin','Juil.','Août','Sept.','Oct.','Nov.','Déc.'], 'dayNames'=\u0026gt;['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], 'dayNamesShort'=\u0026gt;['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'], 'dayNamesMin'=\u0026gt;['D','L','M','M','J','V','S'], 'weekHeader'=\u0026gt;'Sem.', 'dateFormat'=\u0026gt;'dd/mm/yy', 'firstDay'=\u0026gt;1, 'isRTL'=\u0026gt;false, 'showMonthAfterYear'=\u0026gt;false, 'yearSuffix'=\u0026gt;'' ) )); "
},
{
"uri": "https://piklist.github.io/docs/tutorials/fields/display-menus-radio-checkbox-select-list/",
"title": "Display Menus as a Radio, Checkbox or Select list",
"tags": [],
"description": "Using Piklist you can easily display your Menus as Radio, Checkboxes or a Select list (dropdowns). Easily include them in custom theme settings, or when creating posts. This simple tutorial will show you how.",
"content": "Description Using Piklist you can easily display your Menus as Radio, Checkboxes or a Select list (dropdowns). Easily include them in custom theme settings, or when creating posts. This simple tutorial will show you how.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. We’re are going to use the WordPress function wp_get_nav_menus(), to get our menus. This function stores data in an array, and with Piklist, parsing an array and displaying it as a list is really easy. This array stores all menus in an Object, and then breaks them out. You have access to fields like term_id, name, slug, etc. We are going to assign each item in the dropdown to the slug, but show the name:\npiklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'sidebar_left' ,'label' =\u0026gt; 'Choose Sidebar Menu' ,'value' =\u0026gt; 'none' ,'choices' =\u0026gt; array( '' =\u0026gt; 'Choose Menu' ) + piklist(wp_get_nav_menus() ,array( 'slug' ,'name' ) ) )); Let’s take a look at this code:\n First we created a standard Piklist Select list. The only major change is the choices array. We told Piklist to use the wp_get_nav_menus() function. The next array tells Piklist what should be the KEY for the field, and what should be the VALUE. In this case we selected slug as the KEY, and name as the VALUE to show in the list. Checkbox:\nTo make this a Checkbox, just change 'type' =\u0026gt; 'select', to 'type' =\u0026gt; 'checkbox'.\nRadio Buttons:\nTo make this Radio Buttons, just change 'type' =\u0026gt; 'select', to 'type' =\u0026gt; 'radio'.\nYes, it’s that easy!\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/taxonomies-terms/display-taxonomies-radio-checkboxes-select-list/",
"title": "Display Taxonomies as Radio, Checkboxes or Select list",
"tags": [],
"description": "Using Piklist you can easily display your Taxonomies as Radio, Checkboxes or a Select list (dropdowns)",
"content": "Using Piklist you can easily display your Taxonomies as Radio, Checkboxes or a Select list (dropdowns). This simple tutorial will show you how.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. In this example, we are going to pull the standard WordPress categories, this works for custom taxonomies as well.\nWe’re are going to use the WordPress function get_terms(), to get our taxonomy values. This function stores data in an array, and with Piklist, parsing an array and displaying it as a Select List is really easy. As you can see from the WordPress Codex page, this array stores all data in an Object, and then breaks them out. You have access to fields like term_id, name, parent etc. We are going to assign each item in the select list to the term_id, but show the name. This is added to the Piklist parameter choices:\npiklist('field', array( 'type' =\u0026gt; 'select' ,'scope' =\u0026gt; 'taxonomy' ,'field' =\u0026gt; 'category' ,'label' =\u0026gt; 'Categories' ,'description' =\u0026gt; 'Terms will appear when they are added to this taxonomy.' ,'choices' =\u0026gt; array( '' =\u0026gt; 'Choose Term' ) + piklist(get_terms(array( 'taxonomy' =\u0026gt; 'piklist_demo_type' ,'hide_empty' =\u0026gt; false )) ,array( 'term_id' ,'name' ) ) )); Let’s take a look at this code:\n First we created a standard Piklist Select list. Notice we set the scope here. In most cases Piklist will automatically determine the scope. But when SAVING to a taxonomy you will need to set 'scope' =\u0026gt; 'taxonomy'. Here we are saving to the taxonomy \u0026lsquo;category\u0026rsquo;. If this code was on a Settings page, and you wanted to save this data as a Setting, you would not set Scope. The choices array gets pulled in dynamically. We told Piklist to use the get_terms() function, and told it to get the piklist_demo_type taxonomy values. We also passed the hide_empty parameter to Piklist. This parameter is standard to the get_terms() function and can be found at the Codex. The next array tells Pikist what should be the KEY for the field, and what should be the VALUE. In this case we selected term_id as the KEY, and name as the VALUE to show in the list. Radio Buttons: To make these Radio Buttons, just change 'type' =\u0026gt; 'select', to 'type' =\u0026gt; 'radio'.\nCheckboxes: To make these Checkboxes, just change 'type' =\u0026gt; 'select', to 'type' =\u0026gt; 'checkbox'.\nYes, it’s that easy!\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/users/display-users-radio-checkbox-select-list/",
"title": "Display Users as a Radio, Checkbox or Select list",
"tags": [],
"description": "Using Piklist you can easily display your Users as Radio, Checkboxes or a Select list (dropdowns).",
"content": "Using Piklist you can easily display your Users as Radio, Checkboxes or a Select list (dropdowns). This simple tutorial will show you how.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. Now we can get started and write some code! We\u0026rsquo;re are going to use the WordPress function get_users(), to get our users. This function stores data in an array, and with Piklist, parsing an array and displaying it as a Select List is really easy. As you can see from the WordPress Codex page, this array stores all users in an Object, and then breaks them out. You have access to fields like ID, user_login, user_pass, etc. We are going to assign each item in the dropdown to the ID, but show the display_name:\npiklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'my_users' ,'label' =\u0026gt; 'Choose a user' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) ,'choices' =\u0026gt; array( '' =\u0026gt; 'Choose User' ) + piklist( get_users( array( 'orderby' =\u0026gt; 'display_name' ,'order' =\u0026gt; 'asc' ) ,'objects' ) ,array( 'ID' ,'display_name' ) ) )); Let\u0026rsquo;s take a look at this code:\n First we created a standard Piklist Select list. The only major change is the choices array. We told Piklist to use the get_users() function, and then passed the orderby and order parameters to Piklist. These parameters are standard to the get_users() function and can be found at the WordPress Codex. The next array tells Piklist what should be the KEY for the field, and what should be the VALUE. In this case we selected ID as the KEY, and DISPLAY_NAME as the VALUE to show in the list. Checkbox: To make this a Checkbox, just change 'type' =\u0026gt; 'select', to 'type' =\u0026gt; 'checkbox'.\nRadio Buttons: To make this Radio Buttons, just change 'type' =\u0026gt; 'select', to 'type' =\u0026gt; 'radio'.\nYes, it\u0026rsquo;s that easy!\n"
},
{
"uri": "https://piklist.github.io/docs/fields/types/editor/",
"title": "editor Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'editor' Create a standard WordPress editor field.\nYou can use Piklist field parameters to customize this field.\nCustom Parameters The editor field takes any option that can be passed to the WordPress wp_editor() function. You can pass them through the options array. See examples below.\nExamples Basic Editor Field\npiklist('field', array( 'type' =\u0026gt; 'editor', 'field' =\u0026gt; 'my_editor_field', 'label' =\u0026gt; 'Post Content' )); Default Editor\nPiklist can replace the default editor in WordPress by using code the following code.\npiklist('field', array( 'type' =\u0026gt; 'editor', 'field' =\u0026gt; 'post_content', // This is the field name of the WordPress default editor 'scope' =\u0026gt; 'post', // Save to the wp_post table 'label' =\u0026gt; 'Post Content', 'template' =\u0026gt; 'field', // Only display the field not the label 'options' =\u0026gt; array( // Pass any option that is accepted by wp_editor() 'wpautop' =\u0026gt; true, 'media_buttons' =\u0026gt; true, 'shortcode_buttons' =\u0026gt; true, 'teeny' =\u0026gt; false, 'dfw' =\u0026gt; false, 'quicktags' =\u0026gt; true, 'drag_drop_upload' =\u0026gt; true, 'tinymce' =\u0026gt; array( 'resize' =\u0026gt; false, 'wp_autoresize_on' =\u0026gt; true ) ) )); Displaying Editor content\nWordPress has a standard function, the_content(), for displaying data from the post editor. This function automatically gets filtered by WordPress to format your data correctly. When you want to display data from your custom editor field you may also need to duplicate the functionality of `the_content()``.\nGet the field data, and then apply the WordPress filter. Here\u0026rsquo;s an example:\n$my_field = get_post_meta(get_the_ID(), 'field_name', true); echo apply_filters( 'the_content', $my_field ); Run shortcodes: Use do_shortcode() to run shortcodes in your content. echo do_shortcode( get_post_meta( $post-\u0026gt;ID, 'field_name', true ) );\nYou can even use both together:\n$my_field = get_post_meta(get_the_ID(), 'field_name', true); $my_field = apply_filters( 'the_content', $my_field ); echo do_shortcode( $my_field ); "
},
{
"uri": "https://piklist.github.io/docs/fields/types/email/",
"title": "email Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'email' This is an HTML5 field\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;email\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;my_field\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;my field\u0026#39;, )); "
},
{
"uri": "https://piklist.github.io/docs/fields/field-parameters/",
"title": "Field Parameters",
"tags": [],
"description": "This is a full list of available parameters for Piklist fields.",
"content": "This is a full list of available parameters for Piklist fields.\nadd_more (repeater) Piklist allows you to turn ANY field, or group of fields, into a repeater field, by simple adding the add_more parameter.\nDisplaying Data To display the results of the Add-More in your theme, pull the data like you normally would. Add more’s save data as an array, so you can loop though the data to display.\n Input: boolean Default: false Example: 'add_more' =\u0026gt; true\nattributes Adds HTML attributes to your field.\n Input: array 8 values: An array of HTML attributes piklist Example:\narray( 'placeholder' =\u0026gt; 'Enter text' ,'class' =\u0026gt; 'large-text' ) capability Set the user capabilities that will see this field.\n Input: comma-delimited Default: none Examples: 'capability' =\u0026gt; 'create_users' 'capability' =\u0026gt; 'create_users, edit_posts'\nchild_add_more Input: boolean Default: false child_field Input: boolean Default: false choices Create a list of choices. Used with the following fields: checkbox, radio, select.\n Input: array values: An array of choices Example:\n'choices' =\u0026gt; array( 'first' =\u0026gt; 'First Choice', 'second' =\u0026gt; 'Second Choice', 'third' =\u0026gt; 'Third Choice' ) columns Piklist uses a 12 column grid system to help you layout your fields. The grid system is really helpful when laying out group fields.\n Input: numeric values: Any number 1-12 Examples: 'columns' =\u0026gt; 1 'columns' =\u0026gt; 12\nConditions Set conditions for your fields.\n Input: parameters values: An array of conditions Sub Parameters: relation (sub parameter) When using multiple conditions, the default logic is AND. Use this parameter to change the logic to OR. Examples: 'relation' =\u0026gt; 'or' 'relation' =\u0026gt; 'and'\nfield (sub parameter) The name of the field you will be watching for Hide/Show, or the field you will be Updating. Example: 'field' =\u0026gt; 'my_field'\nvalue (sub parameter) The value(s) of the field that will trigger the condition. This parameter also accepts an array of values. Examples: 'value' =\u0026gt; 'yes' 'value' =\u0026gt; array('yes', 'maybe')\nreset (sub parameter) By default, any field that is hidden/shown will have their values reset. To prevent this set reset to false. Example: 'reset' =\u0026gt; 'false'\ncompare (sub parameter) Operator to test the value against. Currently only two values are supported: == and !=.\n default: == Example: 'compare' =\u0026gt; '!='\ntype (sub parameter) Piklist supports two condition types; toggle and update.\n default: toggle Example: 'type' =\u0026gt; update\nscope (sub parameter) IMPORTANT: Only use if you manually set the scope in the field you are monitoring for Hide/Show. Example: 'scope' =\u0026gt; taxonomy\npost_status_hide (sub parameter) post_status_value (sub parameter) Example:\n // Demonstrates a lot of conditional fields working together // Show this field if (guest_meal == steak) or (guest_one_meal == steak) or (guest_two_meal == steak) piklist('field', array( 'type' =\u0026gt; 'html' ,'field' =\u0026gt; '_message_meal' ,'value' =\u0026gt; __('We only serve steaks rare.', 'piklist-demo') ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'piklist-error-text' ) ,'conditions' =\u0026gt; array( 'relation' =\u0026gt; 'or' ,array( 'field' =\u0026gt; 'guest_meal' ,'value' =\u0026gt; 'steak' ) ,array( 'field' =\u0026gt; 'guest_one_meal' ,'value' =\u0026gt; 'steak' ) ,array( 'field' =\u0026gt; 'guest_two_meal' ,'value' =\u0026gt; 'steak' ) ) )); // Update the field 'guests' to 'yes', if this field is set to ('yes' or 'maybe') piklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'attending' ,'label' =\u0026gt; __('Are you coming to the party?', 'piklist-demo') ,'choices' =\u0026gt; array( '' =\u0026gt; '' ,'yes' =\u0026gt; 'Yes' ,'no' =\u0026gt; 'No' ,'maybe' =\u0026gt; 'Maybe' ) ,'conditions' =\u0026gt; array( array( 'field' =\u0026gt; 'guests' ,'value' =\u0026gt; array('yes', 'maybe') ,'update' =\u0026gt; 'yes' ,'type' =\u0026gt; 'update' ) ) )); // Show this field if the field 'attending' is not eqaual to (empty or 'no') piklist('field', array( 'type' =\u0026gt; 'radio' ,'field' =\u0026gt; 'guest_meal' ,'label' =\u0026gt; __('Choose meal type', 'piklist-demo') ,'choices' =\u0026gt; array( 'chicken' =\u0026gt; 'Chicken' ,'steak' =\u0026gt; 'Steak' ,'vegetarian' =\u0026gt; 'Vegetarian' ) ,'conditions' =\u0026gt; array( array( 'field' =\u0026gt; 'attending' ,'value' =\u0026gt; array('', 'no') ,'compare' =\u0026gt; '!=' ) ) )); // Show this field if the field 'attending' is not eqaual to (empty or 'no') piklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'guests' ,'label' =\u0026gt; __('Are you bringing guests', 'piklist-demo') ,'description' =\u0026gt; __('Coming to party != (No or empty)', 'piklist-demo') ,'choices' =\u0026gt; array( 'yes' =\u0026gt; 'Yes' ,'no' =\u0026gt; 'No' ) ,'conditions' =\u0026gt; array( array( 'field' =\u0026gt; 'attending' ,'value' =\u0026gt; array('', 'no') ,'compare' =\u0026gt; '!=' ) ) )); // Show this field if the field 'guests_number' is 3 piklist('field', array( 'type' =\u0026gt; 'html' ,'field' =\u0026gt; '_message_guests' ,'value' =\u0026gt; __('Sorry, only two guests are allowed.', 'piklist-demo') ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'piklist-error-text' ) ,'conditions' =\u0026gt; array( array( 'field' =\u0026gt; 'guests_number' ,'value' =\u0026gt; '3' ) ) )); // Show this field if the field 'attending' is not equal to (empty or 'no') // AND the field 'guests' is 'yes' piklist('field', array( 'type' =\u0026gt; 'number' ,'field' =\u0026gt; 'guests_number' ,'label' =\u0026gt; __('How many guests?', 'piklist-demo') ,'description' =\u0026gt; __('Coming to party != (No or empty) AND Guests = Yes', 'piklist-demo') ,'value' =\u0026gt; 1 ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'small-text' ,'step' =\u0026gt; 1 ,'min' =\u0026gt; 0 ) ,'conditions' =\u0026gt; array( array( 'field' =\u0026gt; 'attending' ,'value' =\u0026gt; array('', 'no') ,'compare' =\u0026gt; '!=' ) ,array( 'field' =\u0026gt; 'guests' ,'value' =\u0026gt; 'yes' ) ) )); // Show this field if the field 'guests_number' not equals (empty or 0) // AND the field 'guests' is 'yes' // AND 'attending' is not equal to (empty or 'no') piklist('field', array( 'type' =\u0026gt; 'group' ,'label' =\u0026gt; __('Guest One', 'piklist-demo') ,'description' =\u0026gt; __('Number of guests != empty', 'piklist-demo') ,'fields' =\u0026gt; array( array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'guest_one' ,'label' =\u0026gt; __('Name', 'piklist-demo') ) ,array( 'type' =\u0026gt; 'radio' ,'field' =\u0026gt; 'guest_one_meal' ,'label' =\u0026gt; __('Meal choice', 'piklist-demo') ,'choices' =\u0026gt; array( 'chicken' =\u0026gt; 'Chicken' ,'steak' =\u0026gt; 'Steak' ,'vegetarian' =\u0026gt; 'Vegetarian' ) ) ) ,'conditions' =\u0026gt; array( array( 'field' =\u0026gt; 'guests_number' ,'value' =\u0026gt; array('', '0') ,'compare' =\u0026gt; '!=' ) ,array( 'field' =\u0026gt; 'guests' ,'value' =\u0026gt; 'yes' ) ,array( 'field' =\u0026gt; 'attending' ,'value' =\u0026gt; array('', 'no') ,'compare' =\u0026gt; '!=' ) ) )); // Show this field if the field 'guests_number' not equals (empty or 0 or 1) // AND 'attending' is not equal to (empty or 'no') piklist('field', array( 'type' =\u0026gt; 'group' ,'label' =\u0026gt; __('Guest Two', 'piklist-demo') ,'description' =\u0026gt; __('Number of guests != (empty or 1)', 'piklist-demo') ,'fields' =\u0026gt; array( array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'guest_two' ,'label' =\u0026gt; __('Name', 'piklist-demo') ) ,array( 'type' =\u0026gt; 'radio' ,'field' =\u0026gt; 'guest_two_meal' ,'label' =\u0026gt; __('Meal choice', 'piklist-demo') ,'choices' =\u0026gt; array( 'chicken' =\u0026gt; 'Chicken' ,'steak' =\u0026gt; 'Steak' ,'vegetarian' =\u0026gt; 'Vegetarian' ) ) ) ,'conditions' =\u0026gt; array( array( 'field' =\u0026gt; 'guests_number' ,'value' =\u0026gt; array('', '0', '1') ,'compare' =\u0026gt; '!=' ) ,array( 'field' =\u0026gt; 'attending' ,'value' =\u0026gt; array('', 'no') ,'compare' =\u0026gt; '!=' ) ) )); data_id Input: string Default: null description The description of your field.\n Input: string Example: 'description' =\u0026gt; 'This is my description'\ndisable_label Input: boolean Default: true display Input: boolean Default: true embed Input: boolean Default: false errors Input: boolean Default: false field The name of your field.\nFor scope: post_meta, term_meta, option: this is the name of the field that will be saved to your database.\nFor scope: post, taxonomy: use the name of the post_type or taxonomy you want to save your data to.\n Input: string Examples: 'field' =\u0026gt; 'my_field'\n'field' =\u0026gt; 'post_type_name'\n'field' =\u0026gt; 'taxonomy_name'\ngroup_field Input: boolean Default: false help Adds tooltip help to your field. This will only display if a label is set for your field.\n Input: string Example: 'help' =\u0026gt; 'Some help text'\nid Adds tooltip help to your field. This will only display if a label is set for your field.\n Input: string Default: null label The label for your field.\n Input: string Example: 'label' =\u0026gt; 'My field'\nlabel_position The position of your label relative to your field.\n Input: string values: before, after Default: before Example: 'label_position' =\u0026gt; 'after'\nlabel_tag Input: boolean Default: true list Display a list field (Checkbox, Radio or Select) as a vertical list or not. True is vertical.\n Input: boolean Default: true Example: 'list' =\u0026gt; false\nlist_type Input: string Default: null list_type_item Input: string Default: null logged_in Show field to only logged in users.\n Input: boolean Default: false meta_query Input: parameters multiple Input: string name Input: string Default: null object_id Input: string Default: null on_post_status Lock the field value when your post is in a certain post status. A range of post statuses can be used by separating them with two hyphens (–).\nOnly used for Post data. on_post_status is now part of the conditions array: post_status_hide, post_status_value\n Input: parameters Examples:\n// lock on publish 'on_post_status' =\u0026gt; array( 'value' =\u0026gt; 'publish' ) // lock on draft or publish 'on_post_status' =\u0026gt; array( 'value' =\u0026gt; array('draft','publish') ) // lock on all statuses between repair and closed 'on_post_status' =\u0026gt; array( 'value' =\u0026gt; 'repair--closed' ) options Input: parameters position Input: string Default: null prefix Input: boolean Default: true query Input: parameters redirect Input: string Default: null relate Allow this field to relate to a post type, user, comment or taxonomy.\n Input: array Default: none Sub Parameter: scope The scope of the item you want to relate to.\nExamples: \u0026quot;scope\u0026quot; =\u0026gt; \u0026quot;post\u0026quot; \u0026quot;scope\u0026quot; =\u0026gt; \u0026quot;user\u0026quot;\nrelate_to Input: string Default: null request_value Input: string Default: null required Make a field required. If this field is not filled in the form will not save.\nNOTE: Piklist uses server-side authentication instead of browser-side authentication to do required verification. The pro is that it’s more secure, the con is that the user has to press “save” before the validation kicks in.\nIf you want the convenience of browser-side verification you could add the HTML5 \u0026ldquo;required\u0026rdquo; attribute as well. See example below.\n Input: boolean Default: false // required with Piklist piklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'text_required' ,'label' =\u0026gt; 'Enter some required text' ,'required' =\u0026gt; true )); // required with Piklist and HTML 5 piklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'text_required_2' ,'label' =\u0026gt; 'Enter some required text' ,'required' =\u0026gt; true ,'attributes' =\u0026gt; array( 'required' =\u0026gt; 'required' // HTML 5 validation ) )); role Set the user role that will see this field.\n Input: comma-delimited Default: none Examples: 'role' =\u0026gt; 'editor' 'role' =\u0026gt; 'super-editor, editor, author'\nsanitize Untrusted data entered into your form should be sanitized and validated before saving. By default Piklist uses the WordPress $wpdb-\u0026gt;prepare method to handle your data, insuring it is SQL-escaped before saving to prevent against SQL injection attacks.\nPiklist also adds another level of sanitization you can use at the field level, and makes it easy to use. A library of sanitization functions are included with Piklist, or you can create your own.\nSince data sanitization depends on the type of data and the context in which it is used, the sanitize parameter allows you to choose how to clean your data, and accepts the following parameters:\n Input: parameters Sub Parameters: type The type of sanitization function to run. 'type' =\u0026gt; 'html_class'\noptions An array of arguments to pass to the function. 'options' =\u0026gt; array( 'fallback' =\u0026gt; 'my-default-fallback' )\ncallback Override the default Piklist callback function with your own. 'callback' =\u0026gt; 'my-custom-callback\nExamples:\n// sanitize parameter example. Must be in field function ,'sanitize' =\u0026gt; array( array( 'type' =\u0026gt; 'html_class' ,'options' =\u0026gt; array( 'fallback' =\u0026gt; 'my-default-class' ) ,'callback' =\u0026gt; 'my-custom-callback' ) ) // Use the built-in sanitize function: file_name piklist('field', array( 'type' =\u0026gt; 'text' ,'label' =\u0026gt; 'File Name' ,'field' =\u0026gt; 'sanitize_file_name' ,'description' =\u0026gt; 'Converts multiple words to a valid file name' ,'sanitize' =\u0026gt; array( array( 'type' =\u0026gt; 'file_name' ) ) )); save_as Input: string save_id Input: string Default: null scope The scope parameter tells Piklist where to save field data. In many cases this is the WordPress database table (i.e. post, post_meta, term, term_meta)\nWhen creating fields for the WordPress admin, in most cases, you do not have to define scope. Piklist will automatically set it for you.\nYou MUST define scope when creating front-end forms.\nPiklist allows you to mix-and-match field types within a form. So, one form can have fields that save information as post_meta, while other fields save to a taxonomy. Scope is what determines where the field data is saved. If you don’t set the scope parameter then it will default to where the field is used. For example, if you are creating a meta-box, then scope will automatically be set to post_meta. When working with front-end forms, you must set the scope for each field, so Piklist knows where to save your data.\nIf you want create a field that saves the post_title, then you would set scope to post, since the post_title field is in the wp_posts database table.\n Input: string Default: piklist_form::get_field_scope() Example: 'scope' =\u0026gt; 'post'\nsortable If set to false, will stop an add_more field from being sortable.\n Input: boolean Default: true tax_query Input: parameters template Define a Piklist field template.\n Input: string type The type of field.\n Input: string Default: text Examples: 'type' =\u0026gt;'text' 'type' =\u0026gt;'radio' 'type' =\u0026gt;'editor' 'type' =\u0026gt;'group'\nvalidate Validate this field with a set of validation rules.\n Input: parameters value The default value for this field.\n Input: string Default: null wrapper Input: string Default: null "
},
{
"uri": "https://piklist.github.io/docs/tutorials/fields/",
"title": "Fields (General)",
"tags": [],
"description": "Tutorials on Piklist Fields",
"content": "Tutorials Conditionally Show Fields\nPiklist makes it easy to show one or more fields, based on the value of another field, and so much more.\n Display Menus as a Radio, Checkbox or Select list\nUsing Piklist you can easily display your Menus as Radio, Checkboxes or a Select list (dropdowns). Easily include them in custom theme settings, or when creating posts. This simple tutorial will show you how.\n Show Fields by User Capability or Role\nInsert a subtitle filed to the Post screen\n Using \u0026#34;Chosen\u0026#34; for select fields\nChosen is a jQuery plugin that makes long, unwieldy select boxes much more user-friendly, and can easily be used with Piklist\n Using \u0026#34;Select2\u0026#34; for select fields\nSelect2 is a jQuery replacement for select boxes, and can easily be used with Piklist\n "
},
{
"uri": "https://piklist.github.io/docs/fields/types/file/",
"title": "file (upload) Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'file' Create a file upload field. Uses either the WordPress media uploader, or a basic uploader.\nCustom Parameters The file field takes the following custom parameters. Include them within the options array.\nbasic\nPiklist allows for two different file upload fields in the WordPress admin, a Basic uploader and the standard Media uploader. To use the Media uploader, do not set this parameter at all.\nNOTES:\n The basic uploader is not supported in Widgets. Use the Media Uploader.\n If the basic uploader is on a form that has validation, and the validation fails, the uploader will be empty.\n Input: Array\n Default: false\n Example: 'basic' =\u0026gt; true\n button\nSet button text.\n Input: Array Example: 'button' =\u0026gt; 'Add File' modal_title\nSet the title in the modal window (Media Uploader only)\n Input: Array Example: 'modal_title' =\u0026gt; 'Add File(s)' preview_size\nThe preview size of the image\n Input: Array values: Any registered image size Default: thumbnail Example: 'preview_size' =\u0026gt; 'medium' save\nSave either the attachment ID or the url to the file to the database.\n Input: Array values: \u0026lsquo;id\u0026rsquo; or \u0026lsquo;url\u0026rsquo; Default: id Example: 'save' =\u0026gt; 'url' piklist('field', array( 'type' =\u0026gt; 'file' ,'field' =\u0026gt; 'my_upload_basic_field' ,'scope' =\u0026gt; 'post_meta' ,'label' =\u0026gt; 'Basic Upload Field' ,'options' =\u0026gt; array( 'basic' =\u0026gt; true ) )); piklist('field', array( 'type' =\u0026gt; 'file' ,'field' =\u0026gt; 'my_upload_field' ,'scope' =\u0026gt; 'post_meta' ,'label' =\u0026gt; 'Media Uploader' ,'options' =\u0026gt; array( 'modal_title' =\u0026gt; 'Add File(s)' ,'button' =\u0026gt; 'Add' ) )); "
},
{
"uri": "https://piklist.github.io/docs/actions-filters/filters/",
"title": "Filters",
"tags": [],
"description": "Piklist Filters",
"content": "piklist_admin_pages\nThe piklist_admin_pages filter lets you register your custom Admin Pages through Piklist. This gives you access to additional functionality that Piklist offers.\n piklist_empty_post_title\nLet’s you programmatically set the post title when adding a new post (post type).\n piklist_part_process\nThe `piklist_part_process` filter is used to filter the parts (e.g. meta-boxes, settings, etc.) before they are saved. This allows you to modify or remove parts before they’re processed.\n piklist_part_process-{$folder}\nThe `piklist_part_process-{$folder}` filter is used to filter the parts (e.g. meta-boxes, settings, etc.) before they are saved. This allows you to modify or remove parts before they’re processed.\n piklist_post_types\nThe piklist_post_types filter lets you register your custom Post Types through Piklist. This gives you access to additional functionality that Piklist offers.\n piklist_pre_update_option\nThe piklist_pre_update_option filter is used to filter the settings input before they are saved\n piklist_pre_update_option_$setting\nThe piklist_pre_update_option_$setting filter is used to filter the settings input before they are saved\n piklist_sanitization_rules\nAdd your own rules to sanitize field data.\n piklist_taxonomies\nExtends the standard WordPress function register_taxonomy with additional features and parameters.\n piklist_validation_rules\nAdd your own rules to validate field data.\n "
},
{
"uri": "https://piklist.github.io/docs/tutorials/forms/",
"title": "Forms",
"tags": [],
"description": "Tutorials on Piklist Forms",
"content": "Tutorials Understanding Front End Forms\nPiklist makes creating Front End forms as easy as creating fields in the WordPress admin\n "
},
{
"uri": "https://piklist.github.io/docs/tutorials/shortcodes/getting-started-with-shortcodes/",
"title": "Getting started with Shortcodes",
"tags": [],
"description": "Creating Shortcodes with Piklist is super easy.",
"content": "Description Creating Shortcodes with Piklist is super easy. In this tutorial, we\u0026rsquo;ll create a shortcode to display post meta in your post content.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. If you don\u0026rsquo;t already have a shortcodes folder, create one: /parts/shortcodes/ Next we need to create the shortcode files. Piklist shortcodes are made up of two: shortcode-name.php: This file holds the shortcode output, and is the only required file for a shortcode. (i.e. example.php) shortcode-name-form.php: Settings fields for your shortcode are placed in this file. (i.e. example-form.php) Shortcode Form File Let’s start with example-form.php, which will hold the fields the user will fill in to control the Shortcode. This file is only required if you want to add settings to your Shortcode.\nAt the top of the file add this code:\n\u0026lt;?php /* Name: Post Meta Description: Embed the value of post meta Shortcode: postmeta Inline: true */ This code is a PHP comment block that tells Piklist a few things:\n Name: Name of your shortcode. Description: A description of your shortcode. Shortcode: The actual shortcode that will appear in your code. Inline: Tells Piklist you want to display the shortcode output inline, instead of in a block. Now, let’s create our field, a text box for the Post Meta key:\npiklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'meta_key' ,'label' =\u0026gt; 'Meta Key' )); At this point, you should see an \u0026ldquo;Add Shortcode\u0026rdquo; button on your edit post screen. If you press it, a form will pop up, and one of the shortcode options will be Meta Key. Enter a meta key and save.\nFull Snippet: Shortcode Form File \u0026lt;?php /* Name: Post Meta Description: Embed the value of post meta Shortcode: postmeta Inline: true */ piklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'meta_key' ,'label' =\u0026gt; 'Meta Key' )); Shortcode Output File The output file is the only required file, since settings may not be necessary for some shortcodes. Open example.php. At the top of the file, we will add a comment block that will control the configuration of the shortcode. This comment block is very similar to what you would see in a standard WordPress plugin or theme. The only required parameter is shortcode:\n\u0026lt;?php /* Shortcode: postmeta */ Now we\u0026rsquo;ll add the output code. All the data you save in the shortcode form is saved in the $arguments array.\nif ( isset( $arguments['meta_key'] ) ) { echo get_post_meta( get_the_id(), $arguments['meta_key'], true ); } Full Snippet: Shortcode Output File \u0026lt;?php /* Shortcode: postmeta */ if ( isset( $arguments['meta_key'] ) ) { echo get_post_meta( get_the_id(), $arguments['meta_key'], true ); } You just built a shortcode!\n"
},
{
"uri": "https://piklist.github.io/docs/fields/types/group/",
"title": "group Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'group' Adds a group of fields.\nIf the main `field` parameter is set, a serialized array is created of all the fields in the group. Not including it saves all the fields as individual meta. Individual meta can easily be searched. The `columns` field parameter is especially helpful in Field Groups for more complex layouts like address blocks. Examples piklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;group\u0026#39; ,\u0026#39;field\u0026#39; =\u0026gt; \u0026#39;address_group\u0026#39; // removing this parameter saves all fields as separate meta ,\u0026#39;label\u0026#39; =\u0026gt; __(\u0026#39;Address (Grouped)\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ,\u0026#39;list\u0026#39; =\u0026gt; false ,\u0026#39;description\u0026#39; =\u0026gt; __(\u0026#39;A grouped field with the field parameter set.\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ,\u0026#39;fields\u0026#39; =\u0026gt; array( array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;text\u0026#39; ,\u0026#39;field\u0026#39; =\u0026gt; \u0026#39;address_1\u0026#39; ,\u0026#39;label\u0026#39; =\u0026gt; __(\u0026#39;Street Address\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ,\u0026#39;required\u0026#39; =\u0026gt; true ,\u0026#39;columns\u0026#39; =\u0026gt; 12 ,\u0026#39;attributes\u0026#39; =\u0026gt; array( \u0026#39;placeholder\u0026#39; =\u0026gt; \u0026#39;Street Address\u0026#39; ) ) ,array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;text\u0026#39; ,\u0026#39;field\u0026#39; =\u0026gt; \u0026#39;address_2\u0026#39; ,\u0026#39;label\u0026#39; =\u0026gt; __(\u0026#39;PO Box, Suite, etc.\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ,\u0026#39;columns\u0026#39; =\u0026gt; 12 ,\u0026#39;attributes\u0026#39; =\u0026gt; array( \u0026#39;placeholder\u0026#39; =\u0026gt; \u0026#39;PO Box, Suite, etc.\u0026#39; ) ) ,array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;text\u0026#39; ,\u0026#39;field\u0026#39; =\u0026gt; \u0026#39;city\u0026#39; ,\u0026#39;label\u0026#39; =\u0026gt; __(\u0026#39;City\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ,\u0026#39;columns\u0026#39; =\u0026gt; 5 ,\u0026#39;attributes\u0026#39; =\u0026gt; array( \u0026#39;placeholder\u0026#39; =\u0026gt; \u0026#39;City\u0026#39; ) ) ,array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;select\u0026#39; ,\u0026#39;field\u0026#39; =\u0026gt; \u0026#39;state\u0026#39; ,\u0026#39;label\u0026#39; =\u0026gt; __(\u0026#39;State\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ,\u0026#39;columns\u0026#39; =\u0026gt; 4 ,\u0026#39;choices\u0026#39; =\u0026gt; piklist_demo_get_states() ) ,array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;text\u0026#39; ,\u0026#39;field\u0026#39; =\u0026gt; \u0026#39;postal_code\u0026#39; ,\u0026#39;label\u0026#39; =\u0026gt; __(\u0026#39;Postal Code\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ,\u0026#39;columns\u0026#39; =\u0026gt; 3 ,\u0026#39;attributes\u0026#39; =\u0026gt; array( \u0026#39;placeholder\u0026#39; =\u0026gt; \u0026#39;Postal Code\u0026#39; ) ) ) )); Usage Display Grouped Fields If the main field value is set for the group, unserialize the contents of the field like this:\n$group_data = get_post_meta($post-\u0026gt;ID, 'address_group', true); $group_data = maybe_unserialize($group_data); // nice WP helper function to unserialize if needed print_r($group_data); // output the results or loop through them with a `foreach` statement. If the main field value is not set for the group, then each field is saved as separate meta. You can retrieve like this:\necho get_post_meta($post-\u0026gt;ID, 'address_1', false); echo get_post_meta($post-\u0026gt;ID, 'address_2', false); echo get_post_meta($post-\u0026gt;ID, 'city', false); echo get_post_meta($post-\u0026gt;ID, 'state', false); echo get_post_meta($post-\u0026gt;ID, 'postal_code', false); "
},
{
"uri": "https://piklist.github.io/docs/tutorials/taxonomies-terms/grouping-child-taxonomies-parents/",
"title": "Grouping child taxonomies by their parents",
"tags": [],
"description": "WordPress hierarchical taxonomies allow you to assign terms to a parent term. In this tutorial we’ll show you how to group the child terms under each parent, and make the parent unselectable, forcing the user to only select the children.",
"content": "WordPress hierarchical taxonomies allow you to assign terms to a parent term. In this tutorial we’ll show you how to group the child terms under each parent, and make the parent unselectable, forcing the user to only select the children.\nThe basis of this tutorial is the flexibility of the Piklist field function, which we will place in a foreach loop.\nThis tutorial assumes you have already created a hierarchical taxonomy or you’re using the default WordPress Categories. In our example we will be using a custom taxonomy called company_type.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. First get the Parents Using the standard WordPress function get_terms(), we will first get all the Parents for this taxonomy. Setting 'parent' =\u0026gt; 0 returns all top-level terms.\n$parents = get_terms('company_type', array( 'hide_empty' =\u0026gt; false ,'parent' =\u0026gt; 0 )); Next, assign the Children Now that we have the parents, we need to loop through each one, then show their child fields using the Piklist Field function. Then we pass some parameters to the Piklist Field function for each Parent ID.\nOnce again we will use the WordPress function get_terms(), to get our child taxonomy values. This function stores data in an array, and with Piklist, parsing an array and displaying it as Checkboxes (or Radio buttons… or a Select box) is really easy. As you can see from the WordPress Codex page, this array stores all data in an Object, and then breaks them out. You have access to fields like term_id, name, child_of etc.\nforeach ($parents as $parent =\u0026gt; $value) { piklist('field', array( 'type' =\u0026gt; 'checkbox' ,'scope' =\u0026gt; 'taxonomy' ,'field' =\u0026gt; 'category' ,'label' =\u0026gt; $value-\u0026gt;name ,'choices' =\u0026gt; piklist( get_terms('category', array( 'hide_empty' =\u0026gt; false ,'child_of' =\u0026gt; $value-\u0026gt;term_id )) ,array( 'term_id' ,'name' ) ) )); } Let’s take a look at this code:\n First we created a standard Piklist Checkbox list. Notice we set the scope here. In most cases Piklist will automatically determine the scope. But when using taxonomies you will need to set 'scope' =\u0026gt; 'taxonomy'. In this example we make the label parameter dynamic, passing it the Parent name $value-\u0026gt;name. The choices array gets pulled in dynamically. We told Piklist to use the get_terms() function, and told it to get the company_type taxonomy values. We also passed it two parameters: hide_empty and child_of. Both standard for get_terms(). We set child_of as the Parent term id: $value-\u0026gt;term_id. The next array in the choices array tells Pikist what should be the KEY for the field, and what should be the VALUE. In this case we selected term_id as the KEY, and name as the VALUE to show in the list. Full snippet $parents = get_terms(array( 'taxonomy' =\u0026gt; 'company_type' ,'hide_empty' =\u0026gt; false ,'parent' =\u0026gt; 0 )); foreach ($parents as $parent =\u0026gt; $value) { piklist('field', array( 'type' =\u0026gt; 'checkbox' ,'scope' =\u0026gt; 'taxonomy' ,'field' =\u0026gt; 'company_type' ,'label' =\u0026gt; $value-\u0026gt;name ,'choices' =\u0026gt; piklist( get_terms(array( 'taxonomy' =\u0026gt; 'company_type' ,'hide_empty' =\u0026gt; false ,'child_of' =\u0026gt; $value-\u0026gt;term_id )) ,array( 'term_id' ,'name' ) ) )); } "
},
{
"uri": "https://piklist.github.io/docs/tutorials/help/",
"title": "Help Tabs",
"tags": [],
"description": "Tutorials on Help Tabs",
"content": "Tutorials Creating Help Tabs for WordPress\nCreating Help Tabs for WordPress is super easy with Piklist.\n "
},
{
"uri": "https://piklist.github.io/docs/fields/types/hidden/",
"title": "hidden Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'hidden' piklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;hidden\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;post_id\u0026#39;, \u0026#39;value\u0026#39; =\u0026gt; $post-\u0026gt;ID // set the value of this hidden field to the Post ID. )); "
},
{
"uri": "https://piklist.github.io/docs/tutorials/meta-boxes/hide-meta-boxes-page-template/",
"title": "Hide Meta Boxes for a Page Template",
"tags": [],
"description": "Using Piklist, you can easily hide some meta boxes when a certain page template is selected in WordPress",
"content": "Using Piklist, you can easily hide some meta boxes when a certain page template is selected in WordPress. This tutorial will show you how using two Piklist filters: piklist_get_file_data and piklist_add_part.\nAll of the code in this tutorial will go in your theme’s functions.php file, or your main plugin file.\nAdd a custom parameter to the Piklist comment block. Pikist uses a number of parameters in the comment block to control access to a meta box. The first step is to tell Piklist you want to use a custom parameter using the piklist_part_data filter. We’ll name our parameter \u0026ldquo;Hide for Template\u0026rdquo;.\nadd_filter('piklist_part_data', 'my_custom_comment_block', 10, 2); function my_custom_comment_block($data, $folder) { // If not a Meta-box section than bail if($folder!= 'meta-boxes') { return $data; } // Allow Piklist to read our custom comment block attribute: \u0026quot;Hide for Template\u0026quot;, and set it to hide_for_template $data['hide_for_template'] = 'Hide for Template'; return $data; } Assign meta-box access to user role, “no-role”, if the page template is selected One of the parameters you can use in the Piklist comment block is role. This allows you to set which user role has access to a meta-box. In this step, we are going to change which user role can view the meta-box ONLY if our page template is selected. We’ll change the meta-box access to a made up user role called “no-role”.\nadd_filter('piklist_part_process_callback', 'my_hide_for_template', 10, 2); function my_hide_for_template($part, $type) { global $post; // If not a meta box than bail if($type != 'meta-boxes') { return $part; } // Check if any page template is set in the comment block if (!empty($part['data']['hide_for_template'])) { // Get the active page template $active_template = pathinfo(get_page_template_slug($post-\u0026gt;ID), PATHINFO_FILENAME); $active_template = empty($active_template) ? 'default' : $active_template; // Does the active page template match what we want to hide? if (strpos($part['data']['hide_for_template'], $active_template) !== false) { // Change meta-box access to user role: no-role $part['data']['role'] = 'no-role'; } } return $part; } Usage In the comment block of the meta-box where you want to restrict access, use your new parameter: Hide for Template\n/* Title: Custom Sections Post type: page Hide for Template: full-width, another-template */ IMPORTANT: You need to change your template and press SAVE to hide the metaboxes.\n"
},
{
"uri": "https://piklist.github.io/docs/fields/types/html/",
"title": "html Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'html' The Piklist html field, allows you to render standard HTML markup and keep the same label/field format as the rest of your fields.\nYou can use Piklist field parameters to customize this field.\npiklist('field', array( 'type' =\u0026gt; 'html', 'label' =\u0026gt; 'HTML Field', 'value' =\u0026gt; '\u0026lt;strong\u0026gt;This is some html\u0026lt;/strong\u0026gt;', )); "
},
{
"uri": "https://piklist.github.io/docs/about-piklist/license/",
"title": "License",
"tags": [],
"description": "",
"content": "The license under which the Piklist software is released is the same as WordPress; the GPLv2 (or later) from the Free Software Foundation. A copy of the license is included with every copy of Piklist, but you can also read the text of the license here.\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/meta-boxes/lock-field-values-based-post-status/",
"title": "Lock Field Values based on Post Status",
"tags": [],
"description": "Piklist allows you to lock a field value (making it read-only), when the post status changes. A perfect example of this is if you want to lock post meta once a post is published.",
"content": "Description Piklist allows you to lock a field value (making it read-only), when the post status changes. A perfect example of this is if you want to lock post meta once a post is published.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. Here’s how we do that:\nCreate your field the standard Piklist way. For this tutorial we will create a text box. The only difference is that you will add the [on_post_status](/fields/field-parameters /#on-post-status) parameter. You’ll notice that it is set to show values when the post status equals publish.\npiklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'text_no' ,'label' =\u0026gt; 'Sample field locked' ,'value' =\u0026gt; 'Not editable' ,'help' =\u0026gt; 'This is help text.' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) ,'on_post_status' =\u0026gt; array( 'value' =\u0026gt; 'publish' ) )); "
},
{
"uri": "https://piklist.github.io/docs/tutorials/media/",
"title": "Media",
"tags": [],
"description": "Tutorials on Media",
"content": "Tutorials Add fields to Media items\nAdd fields to Media library items\n "
},
{
"uri": "https://piklist.github.io/docs/fields/types/month/",
"title": "month Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'month' This is an HTML5 field\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;month\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;my_field\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;email field\u0026#39;, )); "
},
{
"uri": "https://piklist.github.io/docs/fields/types/number/",
"title": "number Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'number' This is an HTML5 field\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;number\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;my_field\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;my field\u0026#39;, )); "
},
{
"uri": "https://piklist.github.io/docs/actions-filters/filters/piklist_admin_pages/",
"title": "piklist_admin_pages",
"tags": [],
"description": "The piklist_admin_pages filter lets you register your custom Admin Pages through Piklist. This gives you access to additional functionality that Piklist offers.",
"content": "apply_filters('piklist_admin_pages', array()); The piklist_admin_pages filter lets you register your custom Admin Pages through Piklist. This gives you access to additional functionality that Piklist offers.\nTo register an Admin Page with Piklist:\n Create a function with your Admin Page parameters. Hook it to the piklist_admin_pages() filter. This code goes in your theme\u0026rsquo;s functions.php file or your plugin file.\nParameters This filter supports every parameter that add_menu_page() supports. Additionally, you may use the following Piklist specific parameters.\nmenu_title Title for the menu\n Input: string 'menu_title' =\u0026gt; 'My Page' capability What user capability can see this page.\n Input: string 'capability' =\u0026gt; 'manage_options' section notice title Page Title\n Input: string 'title' =\u0026gt; 'Welcome to our admin page' sub_menu Should this page be the sub menu of another page.\n Input: string 'sub_menu' =\u0026gt; 'options-general.php' 'sub_menu' =\u0026gt; 'my_menu' menu_slug The url slug of this page.\n Input: string 'menu_slug' =\u0026gt; 'my_menu_settings' setting If this page will be used to save settings, specify the setting.\n Input: string 'setting' =\u0026gt; 'my_setting' page_sections menu_icon URL to an image file for the menu icon\n Input: string (url) 'menu_icon' =\u0026gt; get_stylesheet_directory_uri() . 'images/my-menu-icon.svg' save Show the \u0026ldquo;Save\u0026rdquo; button or not.\n Input: boolean 'save' =\u0026gt; true save_text Text for the Save button\n Input: string Default: Save Changes 'save_text' =\u0026gt; Save your settings page layout EXAMPLE (FROM PIKLIST): add_filter('piklist_admin_pages', 'my_admin_pages'); function my_admin_pages($pages) { $pages[] = array( 'page_title' =\u0026gt; __('About', 'piklist') ,'menu_title' =\u0026gt; __('Piklist', 'piklist') ,'capability' =\u0026gt; defined('PIKLIST_SETTINGS_CAP') ? PIKLIST_SETTINGS_CAP : 'manage_options' ,'menu_slug' =\u0026gt; 'piklist' ,'single_line' =\u0026gt; false ,'menu_icon' =\u0026gt; piklist::$add_ons['piklist']['url'] . '/parts/img/piklist-menu-icon.svg' ,'page_icon' =\u0026gt; piklist::$add_ons['piklist']['url'] . '/parts/img/piklist-page-icon-32.png' ); $pages[] = array( 'page_title' =\u0026gt; __('Piklist Settings', 'piklist') ,'menu_title' =\u0026gt; __('Settings', 'piklist') ,'capability' =\u0026gt; defined('PIKLIST_SETTINGS_CAP') ? PIKLIST_SETTINGS_CAP : 'manage_options' ,'sub_menu' =\u0026gt; 'piklist' ,'menu_slug' =\u0026gt; 'piklist-core-settings' ,'setting' =\u0026gt; 'piklist_core' ,'menu_icon' =\u0026gt; piklist::$add_ons['piklist']['url'] . '/parts/img/piklist-menu-icon.svg' ,'page_icon' =\u0026gt; piklist::$add_ons['piklist']['url'] . '/parts/img/piklist-page-icon-32.png' ,'single_line' =\u0026gt; true ); $pages[] = array( 'page_title' =\u0026gt; __('Piklist Add-ons', 'piklist') ,'menu_title' =\u0026gt; __('Add-ons', 'piklist') ,'capability' =\u0026gt; defined('PIKLIST_SETTINGS_CAP') ? PIKLIST_SETTINGS_CAP : 'manage_options' ,'sub_menu' =\u0026gt; 'piklist' ,'menu_slug' =\u0026gt; 'piklist-core-addons' ,'setting' =\u0026gt; 'piklist_core_addons' ,'menu_icon' =\u0026gt; piklist::$add_ons['piklist']['url'] . '/parts/img/piklist-menu-icon.svg' ,'page_icon' =\u0026gt; piklist::$add_ons['piklist']['url'] . '/parts/img/piklist-page-icon-32.png' ,'single_line' =\u0026gt; true ); return $pages; } "
},
{
"uri": "https://piklist.github.io/docs/actions-filters/filters/piklist_empty_post_title/",
"title": "piklist_empty_post_title",
"tags": [],
"description": "Let’s you programmatically set the post title when adding a new post (post type).",
"content": "apply_filters('piklist_empty_post_title', $data['post_title'], $post_array); Let’s you programmatically set the post title when adding a new post (post type).\nExample:\n// Set the Post Title to \u0026quot;Order #\u0026quot; plus post ID: function set_post_title_to_order_number($data, $post_array) { if ($post_array['post_type'] == 'MY-POST-TYPE') { return 'Order #' . $post_array['ID']; } else { return $data; } } add_filter('piklist_empty_post_title', 'set_post_title_to_order_number', 10, 2); IMPORTANT: This filter works best when there is no title field for posts. To disable the title field, do not pass \u0026ldquo;title\u0026rdquo; to the supports parameter when registering a post type.\nIMPORTANT: You may need to resave your permalinks after loading this function. In the WordPress admin, go to Settings \u0026gt; Permalinks and press save.\n"
},
{
"uri": "https://piklist.github.io/docs/actions-filters/filters/piklist_part_process/",
"title": "piklist_part_process",
"tags": [],
"description": "The `piklist_part_process` filter is used to filter the parts (e.g. meta-boxes, settings, etc.) before they are saved. This allows you to modify or remove parts before they’re processed.",
"content": "apply_filters('piklist_part_process', $_part, $folder); The piklist_part_process filter is used to filter the parts (e.g. meta-boxes, settings, etc.) before they are saved. This allows you to modify or remove parts before they’re processed.\nParameters $part The individual part (e.g. meta-box, setting, etc.) to be modified or removed. It’s an associative array that contains all the information about the part.\n Input: Array $folder The folder the part is stored in. If it’s a meta-box, then this would be “meta-boxes”.\n Input: Array Example:\nLet’s say we have a couple meta-boxes on our default post type. One of the meta-boxes has a field that asks whether this post is about a magician. We then want another meta-box with details about the magician to only show up if it is. To get the details meta-box to only show up in this instance would look like this:\nadd_filter('piklist_part_process', function($part) { global $post; // Make sure this is a post edit screen if ( $post \u0026amp;\u0026amp; 'post' === $post-\u0026gt;post_type ) { // Check that this is the right folder and part if ( 'meta-boxes' === $folder \u0026amp;\u0026amp; 'magician-details.php' === $part['part'] ) { if ( 'yes' !== get_post_meta($post-\u0026gt;ID, 'is_magician', true) ) { return false; } } } return $part; } "
},
{
"uri": "https://piklist.github.io/docs/actions-filters/filters/piklist_part_process_folder/",
"title": "piklist_part_process-{$folder}",
"tags": [],
"description": "The `piklist_part_process-{$folder}` filter is used to filter the parts (e.g. meta-boxes, settings, etc.) before they are saved. This allows you to modify or remove parts before they’re processed.",
"content": "apply_filters(\u0026quot;piklist_part_process-{$folder}\u0026quot;, $_part); The piklist_part_process-{$folder} filter is used to filter the parts (e.g. meta-boxes, settings, etc.) before they are saved. This allows you to modify or remove parts before they’re processed.\nParameters $folder The parts folder you want to filter (e.g. meta-boxes, settings, etc.)\n$part The individual part (e.g. meta-box, setting, etc.) to be modified or removed. It’s an associative array that contains all the information about the part.\n Input: Array $folder The folder the part is stored in. If it’s a meta-box, then this would be “meta-boxes”.\n Input: Array Example:\nLet’s say we have a couple meta-boxes on our default post type. One of the meta-boxes has a field that asks whether this post is about a magician. We then want another meta-box with details about the magician to only show up if it is. To get the details meta-box to only show up in this instance would look like this:\nadd_filter('piklist_part_process', function($part) { global $post; // Make sure this is a post edit screen if ( $post \u0026amp;\u0026amp; 'post' === $post-\u0026gt;post_type ) { // Check that this is the right folder and part if ( 'meta-boxes' === $folder \u0026amp;\u0026amp; 'magician-details.php' === $part['part'] ) { if ( 'yes' !== get_post_meta($post-\u0026gt;ID, 'is_magician', true) ) { return false; } } } return $part; } "
},
{
"uri": "https://piklist.github.io/docs/actions-filters/actions/piklist_parts_process-folder/",
"title": "piklist_parts_process-{$folder}",
"tags": [],
"description": "Signals that parts are in process.",
"content": "do_action(\u0026quot;piklist_parts_process-{$folder}\u0026quot;); Class class-piklist.php\nArguments $folder The parts folder where the file is located ( e.g. meta-boxes, notices, terms, users, etc.).\n"
},
{
"uri": "https://piklist.github.io/docs/actions-filters/actions/piklist_parts_processed-folder/",
"title": "piklist_parts_processed-{$folder}",
"tags": [],
"description": "Signals that parts have been processed.",
"content": "do_action(\u0026quot;piklist_parts_processed-{$folder}\u0026quot;); Class class-piklist.php\nArguments $folder The parts folder where the file is located ( e.g. meta-boxes, notices, terms, users, etc.).\n"
},
{
"uri": "https://piklist.github.io/docs/actions-filters/filters/piklist_post_types/",
"title": "piklist_post_types",
"tags": [],
"description": "The piklist_post_types filter lets you register your custom Post Types through Piklist. This gives you access to additional functionality that Piklist offers.",
"content": "apply_filters('piklist_post_types', self::$post_types); The piklist_post_types filter lets you register your custom Post Types through Piklist. This gives you access to additional functionality that Piklist offers.\nTo register a Post Type with Piklist:\n Create a function with your Post Type parameters. Hook it to the piklist_post_types() filter. This code goes in your theme\u0026rsquo;s functions.php file or your plugin file.\nParameters This filter supports every parameter that register_post_type() supports. Additionally, you may use the following Piklist specific parameters.\nadmin_body_class Add custom classes to the body attribute of any page that displays this post type. In the admin only.\n Input: Array 'admin_body_class' =\u0026gt; array( 'custom-body-class', 'custom-body-class-2 ) edit_columns Change the titles of the columns on the list posts screen.\n Input: Array values: array of items to change. key = default WordPress title, value = new title 'edit_columns' =\u0026gt; array( 'title' =\u0026gt; 'Demo', 'author' =\u0026gt; 'Assigned to' ) hide_meta_box Easily hide meta boxes per post type. Even if the Post Type \u0026ldquo;supports\u0026rdquo; the metabox, you can still hide it\n Input: Array values: array for metaboxes to hide 'hide_meta_box' =\u0026gt; array( 'author' ) hide_post_row_actions Hide the post row actions that show up when you hover over a post in the list posts screen (e.g. edit, quick edit, trash, preview)\n Input: Array values: array of row actions, the key corresponding to the span class attribute of the element 'hide_post_row_actions' =\u0026gt; array( 'trash', 'edit', 'quick-edit' ) hide_screen_options Hide the screen options tab on the post edit screens.\n Input: Array 'hide_screen_options' =\u0026gt; true status Register custom post statuses to use with this Post Type. A few important notes:\n You must define ALL the statuses for your Post Type.\n Statuses are universal, meaning any status you register cannot have the same key as an existing status. If it does, the label you define will change the other status as well.\n You can use any parameter from the WordPress register_post_status function.\n Input: Array\n values: array of statuses and labels\n 'status' =\u0026gt; array( 'new' =\u0026gt; array( 'label' =\u0026gt; 'New', 'public' =\u0026gt; false ) ,'pending' =\u0026gt; array( 'label' =\u0026gt; 'Pending Review', 'public' =\u0026gt; false ) ,'demo' =\u0026gt; array( 'label' =\u0026gt; 'Demo', 'public' =\u0026gt; true, 'exclude_from_search' =\u0026gt; true, 'show_in_admin_all_list' =\u0026gt; true, 'show_in_admin_status_list' =\u0026gt; true ) ,'lock' =\u0026gt; array( 'label' =\u0026gt; 'Lock', 'public' =\u0026gt; true ) ) title Change the “Enter title here” text that appears when you create a new Post.\n Input: Array values: text you want to show 'title' =\u0026gt; 'Enter Custom Title' NOTE: WordPress doesn’t allow a Post Type slug defined as \u0026lsquo;order\u0026rsquo;. This is not allowed 'slug' =\u0026gt; 'order'\nEXAMPLE: add_filter('piklist_post_types', 'piklist_demo_post_types'); function piklist_demo_post_types($post_types) { $post_types['piklist_demo'] = array( 'labels' =\u0026gt; piklist('post_type_labels', 'Piklist Demo') ,'title' =\u0026gt; __('Enter a new Demo Title') ,'menu_icon' =\u0026gt; piklist('url', 'piklist') . '/parts/img/piklist-menu-icon.svg' ,'page_icon' =\u0026gt; piklist('url', 'piklist') . '/parts/img/piklist-page-icon-32.png' ,'supports' =\u0026gt; array( 'title' ,'post-formats' ) ,'public' =\u0026gt; true ,'admin_body_class' =\u0026gt; array( 'custom-body-class' ) ,'has_archive' =\u0026gt; true ,'rewrite' =\u0026gt; array( 'slug' =\u0026gt; 'piklist-demo' ) ,'capability_type' =\u0026gt; 'post' ,'edit_columns' =\u0026gt; array( 'title' =\u0026gt; __('Demo') ,'author' =\u0026gt; __('Assigned to') ) ,'hide_meta_box' =\u0026gt; array( 'author' ) ,'status' =\u0026gt; array( 'new' =\u0026gt; array( 'label' =\u0026gt; 'New' ,'public' =\u0026gt; false ) ,'pending' =\u0026gt; array( 'label' =\u0026gt; 'Pending Review' ,'public' =\u0026gt; false ) ,'demo' =\u0026gt; array( 'label' =\u0026gt; 'Demo' ,'public' =\u0026gt; true ,'exclude_from_search' =\u0026gt; true ,'show_in_admin_all_list' =\u0026gt; true ,'show_in_admin_status_list' =\u0026gt; true ) ,'lock' =\u0026gt; array( 'label' =\u0026gt; 'Lock' ,'public' =\u0026gt; true ) ) ); return $post_types; } "
},
{
"uri": "https://piklist.github.io/docs/actions-filters/filters/piklist_pre_update_option/",
"title": "piklist_pre_update_option",
"tags": [],
"description": "The piklist_pre_update_option filter is used to filter the settings input before they are saved",
"content": "apply_filters('piklist_pre_update_option', $settings, $setting, $new, $old); The piklist_pre_update_option filter is used to filter the settings input before they are saved. This allows you to manipulate the input data, or even add additional settings before the data is entered into the database.\nParameters This filter provides you with the following parameters:\n$settings All key=\u0026gt;value pairs for this setting. If you are using multiple tabs, this will show all settings for all tabs.\n Input: Array $setting The name of the setting getting saved.\nInput: Array\n$new This is the data that was entered into the form BEFORE it’s save\n Input: Array $old The data that is in the database\n Input: Array Example:\n //When the user enters data in the piklist_demo_fields settings page and they press save, add another setting called option_key with the value of option_value. add_filter('piklist_pre_update_option','my_update_option', 10, 4); function my_update_option($settings, $setting, $new, $old) { if ($setting == 'piklist_demo_fields') { $settings['option_key'] = 'option_value'; } return $settings; } "
},
{
"uri": "https://piklist.github.io/docs/actions-filters/filters/piklist_pre_update_option_setting/",
"title": "piklist_pre_update_option_$setting",
"tags": [],
"description": "The piklist_pre_update_option_$setting filter is used to filter the settings input before they are saved",
"content": "apply_filters('piklist_pre_update_option_' . $setting, $settings, $new, $old); The piklist_pre_update_option_$setting filter is used to filter the settings input before they are saved. This allows you to manipulate the input data, or even add additional settings before the data is entered into the database.\nParameters This filter provides you with the following parameters:\n$settings All key=\u0026gt;value pairs for this setting. If you are using multiple tabs, this will show all settings for all tabs.\n Input: Array $new This is the data that was entered into the form BEFORE it’s save\n Input: Array $old The data that is in the database\n Input: Array Example:\n //When the user enters data in the piklist_demo_fields settings page and they press save, add another setting called option_key with the value of option_value. add_filter( 'piklist_pre_update_option_piklist_demo_fields','my_update_option', 10, 3 ); function my_update_option($settings, $new, $old) { $settings['option_key'] = 'option_value'; return $settings; } "
},
{
"uri": "https://piklist.github.io/docs/actions-filters/filters/piklist_sanitization_rules/",
"title": "piklist_sanitization_rules",
"tags": [],
"description": "Add your own rules to sanitize field data.",
"content": "apply_filters('piklist_sanitization_rules', self::$sanitization_rules); Add your own rules to sanitize field data.\nExample:\n// create a sanitization rule called \u0026quot;my_email_sanitization\u0026quot; add_filter('piklist_sanitization_rules', 'sanitize_email_function', 11); function sanitize_email_function($sanitization_rules) { $sanitization_rules['my_email_sanitization'] = array( 'callback' =\u0026gt; 'sanitize_email_callback' ); return $sanitization_rules; } function sanitize_email_callback($value, $field, $options) { return sanitize_email($value); // sanitize_email() is a core WordPress function } Usage:\n'sanitize' =\u0026gt; array( array( 'type' =\u0026gt; 'my_email_sanitization' ) ) "
},
{
"uri": "https://piklist.github.io/docs/actions-filters/filters/piklist_taxonomies/",
"title": "piklist_taxonomies",
"tags": [],
"description": "Extends the standard WordPress function register_taxonomy with additional features and parameters.",
"content": "apply_filters('piklist_taxonomies', self::$taxonomies); Extends the standard WordPress function register_taxonomy() with additional features and parameters.\nParameters piklist_taxonomies supports all parameters from register_taxonomy() as well as these custom parameters:\nobject_type To create a taxonomy for USERS set this parameter user\n Input: Boolean Example:\n'object_type' =\u0026gt; 'user\nhide_meta_box Hide the meta box created by this taxonomy\n Input: Boolean Example:\n\u0026quot;hide_meta_box\u0026quot; =\u0026gt; true\nmeta_box_filter Add a filter to this meta box to make it easier to search for terms.\n Input: Boolean Example:\n\u0026quot;meta_box_filter\u0026quot; =\u0026gt; true\n"
},
{
"uri": "https://piklist.github.io/docs/actions-filters/filters/piklist_validation_rules/",
"title": "piklist_validation_rules",
"tags": [],
"description": "Add your own rules to validate field data.",
"content": "apply_filters('piklist_validation_rules', self::$validation_rules); Add your own rules to validate field data.\nExample:\nadd_filter('piklist_validation_rules', 'check_valid_number', 11); function check_valid_number($validation_rules) { $validation_rules['my_number'] = array( 'rule' =\u0026gt; \u0026quot;/[-+]?[0-9]*[.,]?[0-9]+/\u0026quot; ,'message' =\u0026gt; __('is not a number') ); return $validation_rules; } Usage:\n'validate' =\u0026gt; array( array( 'type' =\u0026gt; 'my_number' ) ) Create a rule with a callback function:\n// Create a validation rule called \u0026quot;my_file_exists\u0026quot; add_filter('piklist_validation_rules', 'check_file_exists', 11); function check_file_exists($validation_rules) { $validation_rules['my_file_exists'] = array( 'callback' =\u0026gt; 'my_validate_file_exists' ); return $validation_rules; } /** * @param int $index The field index being checked. * @param mixed $value The value of the field. * @param array $options The options. * @param array $field The field object. * @param array $fields Collection of fields. */ function my_validate_file_exists($index, $value, $options, $field, $fields) { return @file_get_contents($value) ? true : 'contains a file that does not exist.'; } "
},
{
"uri": "https://piklist.github.io/docs/tutorials/workflows/placing-add-new-post-workflow/",
"title": "Placing "Add New Post" in a Workflow",
"tags": [],
"description": "Use the Workflows to divide the default WordPress add new Post page.",
"content": "Piklist’s Workflow system is incredibly powerful. It allows you to divide a page into different tabs. In this tutorial, we’ll use the Workflows to divide the default WordPress add new Post page.\n Review the \u0026ldquo;Building Your First Workflow\u0026rdquo; tutorial to get an idea how they work. For this tutorial, we will need to create one Workflow HEADER, and two Workflow TAB files. Additionally, we will need to write a quick function as well.\n First create your Workflow HEADER file. A header file is determined by setting the header parameter to true. It can be named anything and should contain just a comment block that looks like this:\n \u0026lt;?php /* Flow: Add Post Page: post.php, post-new.php, post-edit.php Post Type: post Header: true Position: title */ Let’s break down the comment block:\n Flow: we are naming this flow “Add Post”. This is just a name that ties all the workflow files together. Page: Which pages should this flow appear on. Post Type: What post type should this flow work with. Header: Since this is the header file, this parameter should be true. Position: Where the flow should start on the page. In this case we are using \u0026ldquo;title\u0026rdquo;, which Piklist maps to the WordPress edit_form_after_title action. Now we are going to create two TAB files, for the two steps in this Workflow. Again, the files can be named anything. As long as they have these comment blocks, and are located in your parts/workflows directory, Piklist will render them. Here are the comment blocks for the two files:\n\u0026lt;?php /* Title: Step 1 Order: 10 Flow: Add Post Default: true */ \u0026lt;?php /* Title: Step 2 Order: 20 Flow: Add Post */ Let’s break down these comment blocks:\n Title: Tab title Order: What order should this tab appear in the flow. Flow: This is the same as we defined in the header file. Default: Which is the default tab. At this point, you should have the Workflow setup with two tabs, with the Editor appearing in both. The next step is to only have the Editor appear in Step 1… so we need to remove it from Step 2. We are going to use the WordPress function remove_post_type_support to remove the Editor from Step 2. In your plugin file, or themes functions.php file, place this code:\nfunction my_remove_from_flow() { if ( isset( $_REQUEST['flow'] ) \u0026amp;\u0026amp; $_REQUEST['flow'] == 'add_post' \u0026amp;\u0026amp; $_REQUEST['flow_page'] == 'step_2' ) { remove_post_type_support( 'post', 'editor' ); } } add_action( 'admin_init', 'my_remove_from_flow' ); This code is hooking to admin_init(), and looking at the HTTP Request variable. If $_REQUEST is set to flow, and the flow is add_post (set in the header file), and the flow_page is step_2, then remove post type support for the Editor with Posts.\nThat’s it! You now have the default Add New Post page placed in a Piklist Flow. Refer to the Building Your First Workflow Tutorial to find out how to add fields to Step 2 of your Workflow.\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/pointers/",
"title": "Pointers",
"tags": [],
"description": "Tutorials on Pointers",
"content": "Tutorials Building Pointers without code\nPiklist let\u0026#39;s you build WordPress pointers without code.\n "
},
{
"uri": "https://piklist.github.io/docs/tutorials/meta-boxes/",
"title": "Posts / Meta-boxes",
"tags": [],
"description": "Tutorials on Post Types and Meta-boxes",
"content": "Tutorials Getting Started with Meta-boxes and Fields\nPiklist makes it radically easy to add metaboxes and fields to your posts, pages or custom post types. In this tutorial, we will create a metabox that includes three fields, select, text and ColorPicker, for standard posts.\n Add Subtitle field to the Post screen\nInsert a subtitle filed to the Post screen\n Add WYSISYG to your Excerpt Box\nTo add some style to your excerpts, you can easily add a WYSIWYG editor to your excerpt box.\n Creating Custom Post Statuses\nCustom Post Statuses are at the heart of any web application built with WordPress, and Piklist makes it easy for you to implement them.\n Hide Meta Boxes for a Page Template\nUsing Piklist, you can easily hide some meta boxes when a certain page template is selected in WordPress\n Lock Field Values based on Post Status\nPiklist allows you to lock a field value (making it read-only), when the post status changes. A perfect example of this is if you want to lock post meta once a post is published.\n Registering Post Types\nAdd some extra power to your Post Types by registering them the Piklist way.\n Show Metaboxes and Fields by Post Status\nWith web applications and powerful websites, there will be times you want to only show a metabox or metafield when a post is in a particular post status.\n "
},
{
"uri": "https://piklist.github.io/docs/fields/types/radio/",
"title": "radio Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'radio' piklist('field', array( 'type' =\u0026gt; 'radio', 'field' =\u0026gt; 'my_radio', 'label' =\u0026gt; 'Radio', 'choices' =\u0026gt; array( 'first' =\u0026gt; 'First Choice', 'second' =\u0026gt; 'Second Choice', 'third' =\u0026gt; 'Third Choice' ) )); "
},
{
"uri": "https://piklist.github.io/docs/fields/types/range/",
"title": "range Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'range' This is an HTML5 field\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;range\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;my_field\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;my field\u0026#39;, \u0026#39;attributes\u0026#39; =\u0026gt; array( \u0026#39;min\u0026#39; =\u0026gt; 5 ,\u0026#39;max\u0026#39; =\u0026gt; 30 ,\u0026#39;step\u0026#39; =\u0026gt; 5 ) )); "
},
{
"uri": "https://piklist.github.io/docs/tutorials/meta-boxes/registering-post-types/",
"title": "Registering Post Types",
"tags": [],
"description": "Add some extra power to your Post Types by registering them the Piklist way.",
"content": "Piklist works well with existing Post Types… those created with the standard WordPress function register_post_type. However, you can add some extra power to your Post Types by registering them the Piklist way. Piklist extends the register_post_type function with extra parameters to enable extra features. You can use the standard register_post_type() parameters, plus the additional Piklist Custom Post Type parameters.\nTo learn more about registering Post Types with Piklist, please read about the piklist_post_types filter.\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/relationships/",
"title": "Relationships",
"tags": [],
"description": "Tutorials on Object Relationships",
"content": "Tutorials Working with Field Relationships\nPiklist allows you to relate any object to any object.\n "
},
{
"uri": "https://piklist.github.io/docs/tutorials/shortcodes/save-shortcode-data-to-database/",
"title": "Save Shortcode data to database",
"tags": [],
"description": "Save Shortcode data to database",
"content": "Description With Piklist you can save shortcode data to your database instead of the WordPress editor.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. In this tutorial we\u0026rsquo;ll save add_more (repeater) data to the database, since this data would be difficult to show in a standard shortcode.\nCreate the field Open or create your shortcodes form file and add this field:\npiklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'my_shortcode_saved_to_db' ,'scope' =\u0026gt; 'post_meta' ,'save_id' =\u0026gt; isset($shortcode['attributes']['my_shortcode_saved_to_db']) ? (int) $shortcode['attributes']['my_shortcode_saved_to_db'] : true // Get the meta_id from the shortcode ,'label' =\u0026gt; 'Demo shortcode' ,'add_more' =\u0026gt; true )); A few things about this field:\n We are setting the scope to post_meta, to tell Piklist where to save the data. This can also be user_meta, term_meta, etc. The save_id parameter is the meta_id in your database. This line is telling Piklist to retrieve the meta_id. This is what will be shown in the post editor. Save the meta data Add the following directly under the above field.\n// Get the last field rendered $field = piklist('field'); // Store our meta id on the shortcode using the same field name as the post_meta for easy reference. Yes, we know there are two fields in this file with the same name, `my_shortcode_saved_to_db`. Don't worry, it's fine. piklist('field', array( 'type' =\u0026gt; 'hidden' ,'field' =\u0026gt; 'my_shortcode_saved_to_db' ,'value' =\u0026gt; $field['data_id'] )); The shortcode itself will render something like [source_information sources_group=\u0026quot;506\u0026quot;]Your text here[/source_information] in your post. In this example the 506, is the meta_id from the database. Since you can use this shortcode multiple times in one post, this is the only ID that is unique to this row.\nIf you save this shortcode you should see the my_shortcode_saved_to_db field in your database. You can then retrieve it normally.\n"
},
{
"uri": "https://piklist.github.io/docs/fields/types/search/",
"title": "search Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'search' This is an HTML5 field\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;search\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;my_field\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;my field\u0026#39;, )); "
},
{
"uri": "https://piklist.github.io/docs/fields/types/select/",
"title": "select Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'select' Basic Select Field\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;select\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;my_select\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;My select\u0026#39;, \u0026#39;choices\u0026#39; =\u0026gt; array( \u0026#39;first\u0026#39; =\u0026gt; \u0026#39;First Choice\u0026#39;, \u0026#39;second\u0026#39; =\u0026gt; \u0026#39;Second Choice\u0026#39;, \u0026#39;third\u0026#39; =\u0026gt; \u0026#39;Third Choice\u0026#39; ) )); Select Field with Optgroup\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;select\u0026#39; ,\u0026#39;field\u0026#39; =\u0026gt; \u0026#39;select_optgroup\u0026#39; ,\u0026#39;label\u0026#39; =\u0026gt; __(\u0026#39;Select with Option Groups\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ,\u0026#39;value\u0026#39; =\u0026gt; \u0026#39;third\u0026#39; ,\u0026#39;choices\u0026#39; =\u0026gt; array( \u0026#39;Group 1\u0026#39; =\u0026gt; array( \u0026#39;first\u0026#39; =\u0026gt; __(\u0026#39;First Choice\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ,\u0026#39;second\u0026#39; =\u0026gt; __(\u0026#39;Second Choice\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ,\u0026#39;third\u0026#39; =\u0026gt; __(\u0026#39;Third Choice\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ) ,\u0026#39;Group 2\u0026#39; =\u0026gt; array( \u0026#39;first\u0026#39; =\u0026gt; __(\u0026#39;First Choice\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ,\u0026#39;second\u0026#39; =\u0026gt; __(\u0026#39;Second Choice\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ,\u0026#39;third\u0026#39; =\u0026gt; __(\u0026#39;Third Choice\u0026#39;, \u0026#39;piklist-demo\u0026#39;) ) ) )); Multiselect\nAdd the following to the attributes array 'multiple' =\u0026gt; 'multiple'\npiklist('field', array( 'type' =\u0026gt; 'select', 'field' =\u0026gt; 'my_multiselect', 'label' =\u0026gt; 'My Multiselect', 'choices' =\u0026gt; array( 'first' =\u0026gt; 'First Choice', 'second' =\u0026gt; 'Second Choice', 'third' =\u0026gt; 'Third Choice' ), 'attributes' =\u0026gt; array( 'multiple' =\u0026gt; 'multiple' // Allow a select field to accept multiple selections ) )); "
},
{
"uri": "https://piklist.github.io/docs/tutorials/settings/",
"title": "Settings",
"tags": [],
"description": "Tutorials on Settings",
"content": "Tutorials Building Settings Pages\nCreating WordPress Settings pages with Piklist is as easy as creating any other field type.\n "
},
{
"uri": "https://piklist.github.io/docs/tutorials/shortcodes/",
"title": "Shortcodes",
"tags": [],
"description": "Tutorials on Shortcodes",
"content": "Tutorials Getting started with Shortcodes\nCreating Shortcodes with Piklist is super easy.\n Save Shortcode data to database\nSave Shortcode data to database\n "
},
{
"uri": "https://piklist.github.io/docs/tutorials/fields/show-fields-user-capability-role/",
"title": "Show Fields by User Capability or Role",
"tags": [],
"description": "Insert a subtitle filed to the Post screen",
"content": "With web applications and powerful websites, there will be times you want to only show a metabox or metafield to a particular user role or capability. For an Order Management system you may want your customers to see certain fields, while your employees can see them all. Or maybe you want Administrators and Editors to be able to leave notes on a post that no one else can see. Well, Piklist makes it easy to do just that.\nIn this tutorial, we will show you how you can easily control who sees your data.\nPiklist allows you to show/hide either the entire metabox, or each individual field… with just one line of code.\nJust add the capability or role parameter to your field:\npiklist('field', array( 'type' =\u0026gt; 'text' ,'scope' =\u0026gt; 'post_meta' ,'field' =\u0026gt; 'demo_text' ,'label' =\u0026gt; 'Text box' ,'description' =\u0026gt; 'Field Description' ,'value' =\u0026gt; 'Default text' ,'capability' =\u0026gt; 'edit_pages' ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); "
},
{
"uri": "https://piklist.github.io/docs/tutorials/meta-boxes/show-metaboxes-fields-post-status/",
"title": "Show Metaboxes and Fields by Post Status",
"tags": [],
"description": "With web applications and powerful websites, there will be times you want to only show a metabox or metafield when a post is in a particular post status.",
"content": "With web applications and powerful websites, there will be times you want to only show a meta-box or metafield when a post is in a particular post status. This becomes extra powerful when paired with the Piklist capability parameter, which allows you to show/hide a field based on a user role or capability. For an Order Management system, you may want an order notes field hidden until the estimate becomes an order. Well, Piklist makes it easy to do just that.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. In this tutorial, you will learn how to show or hide a meta-box or meta-field based on the Post Status.\n First let’s build a meta-box using our \u0026ldquo;Getting Started\u0026rdquo; tutorial. Once completed you should have a working Meta Box with three fields. Piklist allows you to show/hide the entire Meta Box by using the status parameter, or by individual field by using the on_post_status parameter. SHOW entire Meta Box by Post Status(es) In the comment block at the top of your meta box file (demo-metabox.php if you used the base tutorial), add the following line of code:\nStatus: draft\nNow, this meta box will only show when the post is in the draft status.\nYou can also use a list of Post Statuses. For example, let’s says you have an Order Management system and you created your own set of custom post statuses. You only want to show this meta box when the order (a custom post type) is in the estimate and estimate-approved statuses. You would list them separately by a comma, with NO SPACES. So your code would look like this:\nStatus: estimate,estimate-approved\nIf you started with our base tutorial, then your full header code snippet would look like this:\n\u0026lt;?php /* Title: My Demo Meta Box Post Type: post Status: estimate,estimate-approved */ HIDE a Meta Field by Post Status(es) You can also hide individual fields by post status. Again, we start with the base tutorial. In this example, let’s hide the text box only when the post is in the publish status. Here we use the on_post_status parameter, which takes takes an array of parameters. It’s a little bit more complicated, but you can just copy and paste the code.\n'on_post_status' =\u0026gt; array( 'hide' =\u0026gt; 'publish' ) If we go back to our Order Management system example, we may want to hide this field if the order is in any of the following post statuses: ready-to-ship, in-shipping, shipped and closed. You can list them like this:\n'on_post_status' =\u0026gt; array( 'hide' =\u0026gt; array( 'ready-to-ship','in-shipping','shipped','closed' ) ) If the statuses are in order, you can also just use a range of post statuses, separated by a double-hyphen. This code does the same thing as the one above:\n'on_post_status' =\u0026gt; array( 'hide' =\u0026gt; 'ready-to-ship--closed' ) The entire snippet for this field would look like this:\npiklist('field', array( 'type' =\u0026gt; 'text' ,'field' =\u0026gt; 'demo_text' ,'label' =\u0026gt; 'Text box' ,'description' =\u0026gt; 'Field Description' ,'value' =\u0026gt; 'Default text' ,'on_post_status' =\u0026gt; array( 'hide' =\u0026gt; 'publish' ) ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'text' ) )); "
},
{
"uri": "https://piklist.github.io/docs/tags/",
"title": "Tags",
"tags": [],
"description": "",
"content": ""
},
{
"uri": "https://piklist.github.io/docs/tutorials/taxonomies-terms/",
"title": "Taxonomies / Terms",
"tags": [],
"description": "Tutorials on Taxonomies / Terms",
"content": "Tutorials Getting Started with Taxonomies and Piklist\nAdd some extra power to your Taxonomies by registering them the Piklist way.\n Creating Separate Taxonomies for each User\nIn this tutorial we’ll provide each logged in user with their own set of private tags.\n Display Taxonomies as Radio, Checkboxes or Select list\nUsing Piklist you can easily display your Taxonomies as Radio, Checkboxes or a Select list (dropdowns)\n Grouping child taxonomies by their parents\nWordPress hierarchical taxonomies allow you to assign terms to a parent term. In this tutorial we’ll show you how to group the child terms under each parent, and make the parent unselectable, forcing the user to only select the children.\n "
},
{
"uri": "https://piklist.github.io/docs/fields/types/tel/",
"title": "tel Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'tel' This is an HTML5 field\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;tel\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;my_field\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;my field\u0026#39;, )); "
},
{
"uri": "https://piklist.github.io/docs/fields/types/text/",
"title": "text Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'text' piklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;text\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;my_text\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;Text\u0026#39;, \u0026#39;attributes\u0026#39; =\u0026gt; array( \u0026#39;class\u0026#39; =\u0026gt; \u0026#39;regular-text\u0026#39; // WordPress css class ) )); "
},
{
"uri": "https://piklist.github.io/docs/fields/types/textarea/",
"title": "textarea Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'textarea' piklist('field', array( 'type' =\u0026gt; 'textarea', 'field' =\u0026gt; 'my_textarea', 'label' =\u0026gt; 'Text Area', 'attributes' =\u0026gt; array( 'rows' =\u0026gt; 10, 'cols' =\u0026gt; 50, 'class' =\u0026gt; 'large-text' ) )); "
},
{
"uri": "https://piklist.github.io/docs/fields/types/time/",
"title": "time Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'time' This is an HTML5 field\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;time\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;my_field\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;my field\u0026#39;, )); "
},
{
"uri": "https://piklist.github.io/docs/tutorials/forms/understanding-front-end-forms/",
"title": "Understanding Front End Forms",
"tags": [],
"description": "Piklist makes creating Front End forms as easy as creating fields in the WordPress admin",
"content": "Piklist makes creating Front End forms as easy as creating fields in the WordPress admin. In most cases you can use the same field code you used in the admin, plus you need to define the scope parameter. scope tells Piklist where to save your data. In the admin, this can be auto-detected, but not with front-end forms.\n New to Piklist? Before you start this tutorial: Install Piklist like you would any other WordPress plugin. Decide if you are going to add the code in this tutorial to your custom plugin or your theme. This will define how to setup your Piklist folder structure. If you're new to Piklist, you may want to review the \"Getting Started\" tutorial first. It gives you a good overview of how Piklist works. Front end form code goes in your forms/ folder.\n Start adding fields to your form. Remember to set the scope parameter to each field. Once you’re finished adding your fields, you will also need to add a submit button:\npiklist('field', array( 'type' =\u0026gt; 'submit' ,'field' =\u0026gt; 'submit' ,'value' =\u0026gt; 'Submit' )); Once your form is saved, Piklist will automatically create a shortcode for it. You can use this shortcode to access your form.\nIf your form is in a PLUGIN (i.e. wp-content/plugins/my-plugin/parts/forms/my-form.php), you should use this shortcode:\n[piklist_form form=\u0026quot;my-form\u0026quot; add_on=\u0026quot;my-plugin\u0026quot;]\n\u0026quot;my-form\u0026quot;: the name of the file in your forms/ folder \u0026quot;my-plugin\u0026quot;: the name of your plugin slug\nIf your form is in a THEME (i.e. wp-content/themes/my-theme/piklist/parts/forms/my-form.php), then use a shortcode like this:\n`[piklist_form form=\u0026ldquo;my-form\u0026rdquo; add_on=\u0026ldquo;theme\u0026rdquo;]'\n\u0026quot;my-form\u0026quot;: the name of the file in your forms/ folder `\u0026ldquo;theme\u0026rdquo;: leave this set to the word \u0026ldquo;theme\u0026rdquo;\nSample forms are included in the built-in Piklist Demos: /plugins/piklist/add-ons/piklist-demos/parts/forms/\n"
},
{
"uri": "https://piklist.github.io/docs/tutorials/updates/",
"title": "Updates",
"tags": [],
"description": "Tutorials on Updates",
"content": "Tutorials Getting started with updates\nUse Piklist updates to run your update scripts\n "
},
{
"uri": "https://piklist.github.io/docs/fields/types/url/",
"title": "url Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'url' This is an HTML5 field\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;url\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;my_field\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;my field\u0026#39;, )); "
},
{
"uri": "https://piklist.github.io/docs/tutorials/users/",
"title": "Users",
"tags": [],
"description": "Tutorials on Users",
"content": "Tutorials Display Users as a Radio, Checkbox or Select list\nUsing Piklist you can easily display your Users as Radio, Checkboxes or a Select list (dropdowns).\n "
},
{
"uri": "https://piklist.github.io/docs/tutorials/fields/using-chosen/",
"title": "Using "Chosen" for select fields",
"tags": [],
"description": "Chosen is a jQuery plugin that makes long, unwieldy select boxes much more user-friendly, and can easily be used with Piklist",
"content": "Description Piklist makes it easy to create select boxes, but sometimes they can become long with tons of options. Using the \u0026ldquo;Chosen\u0026rdquo; jQuery plugin from Harvest can make them more user-friendly.\n First, let\u0026rsquo;s load two files from Chosen. Their javascript and css file. Though the javascript is mandatory, the css is not. You can just borrow from this file if you want. In your theme\u0026rsquo;s functions.php file, or your main plugin file add this code:\nfunction my_enqueue_files() { wp_enqueue_style( 'chosen_styles', 'https://harvesthq.github.io/chosen/chosen.css', false ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'chosen_js', 'https://harvesthq.github.io/chosen/chosen.jquery.js', array('jquery'), null, true ); } add_action( 'wp_enqueue_scripts', 'my_enqueue_files' ); Note: for backend (admin) pages like a post editor, use admin_enqueue_scripts action hook instead:\nadd_action( 'admin_enqueue_scripts', 'my_enqueue_files' ); Now let\u0026rsquo;s add a select field with lots of options. Add this field to the proper file in your /parts folder: piklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'us_states' ,'label' =\u0026gt; 'Select a state' ,'required' =\u0026gt; true ,'choices' =\u0026gt; array( '' =\u0026gt; '' ,'AL' =\u0026gt; 'AL' ,'AK' =\u0026gt; 'AK' ,'AZ' =\u0026gt; 'AZ' ,'AR' =\u0026gt; 'AR' ,'CA' =\u0026gt; 'CA' ,'CO' =\u0026gt; 'CO' ,'CT' =\u0026gt; 'CT' ,'DE' =\u0026gt; 'DE' ,'DC' =\u0026gt; 'DC' ,'FL' =\u0026gt; 'FL' ,'GA' =\u0026gt; 'GA' ,'HI' =\u0026gt; 'HI' ,'ID' =\u0026gt; 'ID' ,'IL' =\u0026gt; 'IL' ,'IN' =\u0026gt; 'IN' ,'IA' =\u0026gt; 'IA' ,'KS' =\u0026gt; 'KS' ,'KY' =\u0026gt; 'KY' ,'LA' =\u0026gt; 'LA' ,'ME' =\u0026gt; 'ME' ,'MD' =\u0026gt; 'MD' ,'MA' =\u0026gt; 'MA' ,'MI' =\u0026gt; 'MI' ,'MN' =\u0026gt; 'MN' ,'MS' =\u0026gt; 'MS' ,'MO' =\u0026gt; 'MO' ,'MT' =\u0026gt; 'MT' ,'NE' =\u0026gt; 'NE' ,'NV' =\u0026gt; 'NV' ,'NH' =\u0026gt; 'NH' ,'NJ' =\u0026gt; 'NJ' ,'NM' =\u0026gt; 'NM' ,'NY' =\u0026gt; 'NY' ,'NC' =\u0026gt; 'NC' ,'ND' =\u0026gt; 'ND' ,'OH' =\u0026gt; 'OH' ,'OK' =\u0026gt; 'OK' ,'OR' =\u0026gt; 'OR' ,'PA' =\u0026gt; 'PA' ,'RI' =\u0026gt; 'RI' ,'SC' =\u0026gt; 'SC' ,'SD' =\u0026gt; 'SD' ,'TN' =\u0026gt; 'TN' ,'TX' =\u0026gt; 'TX' ,'UT' =\u0026gt; 'UT' ,'VT' =\u0026gt; 'VT' ,'VA' =\u0026gt; 'VA' ,'WA' =\u0026gt; 'WA' ,'WV' =\u0026gt; 'WV' ,'WI' =\u0026gt; 'WI' ,'WY' =\u0026gt; 'WY' ) ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'chosen-select' ,'data-placeholder' =\u0026gt; 'Choose a State' ) )); Let\u0026rsquo;s take a closer look at this field:\nUnder attributes, we\u0026rsquo;ve assigned:\n 'class' =\u0026gt; 'chosen-select': This can be any class you want, but it will allow the Chosen JS to convert this field. ,'data-placeholder' =\u0026gt; 'Choose a State': Set placeholder text. Notice we also set the first choice as empty. This is necessary so Chosen can apply the placeholder.\n Last, we need to add some jQuery and pass Chosen options. You can find a full list of options here.\nYou can enqueue this code in a separate file, or if you like, you can include it in the same file as your field code:\n\u0026lt;script\u0026gt; jQuery(document).ready(function () { jQuery(\u0026quot;.chosen-select\u0026quot;).chosen({ search_contains: true, no_results_text: \u0026quot;Nothing found for: \u0026quot;, width: \u0026quot;100%\u0026quot;, }); }); \u0026lt;/script\u0026gt; IMPORTANT: notice that we\u0026rsquo;ve included the class chosen-select, from the field code, in the jQuery script. This tells Chosen which field you want to convert.\n Full Code Snippet: \u0026lt;?php /* Title: Select Fields Post Type: post */ piklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'us_states' ,'label' =\u0026gt; 'Select a state' ,'required' =\u0026gt; true ,'choices' =\u0026gt; array( '' =\u0026gt; '' ,'AL' =\u0026gt; 'AL' ,'AK' =\u0026gt; 'AK' ,'AZ' =\u0026gt; 'AZ' ,'AR' =\u0026gt; 'AR' ,'CA' =\u0026gt; 'CA' ,'CO' =\u0026gt; 'CO' ,'CT' =\u0026gt; 'CT' ,'DE' =\u0026gt; 'DE' ,'DC' =\u0026gt; 'DC' ,'FL' =\u0026gt; 'FL' ,'GA' =\u0026gt; 'GA' ,'HI' =\u0026gt; 'HI' ,'ID' =\u0026gt; 'ID' ,'IL' =\u0026gt; 'IL' ,'IN' =\u0026gt; 'IN' ,'IA' =\u0026gt; 'IA' ,'KS' =\u0026gt; 'KS' ,'KY' =\u0026gt; 'KY' ,'LA' =\u0026gt; 'LA' ,'ME' =\u0026gt; 'ME' ,'MD' =\u0026gt; 'MD' ,'MA' =\u0026gt; 'MA' ,'MI' =\u0026gt; 'MI' ,'MN' =\u0026gt; 'MN' ,'MS' =\u0026gt; 'MS' ,'MO' =\u0026gt; 'MO' ,'MT' =\u0026gt; 'MT' ,'NE' =\u0026gt; 'NE' ,'NV' =\u0026gt; 'NV' ,'NH' =\u0026gt; 'NH' ,'NJ' =\u0026gt; 'NJ' ,'NM' =\u0026gt; 'NM' ,'NY' =\u0026gt; 'NY' ,'NC' =\u0026gt; 'NC' ,'ND' =\u0026gt; 'ND' ,'OH' =\u0026gt; 'OH' ,'OK' =\u0026gt; 'OK' ,'OR' =\u0026gt; 'OR' ,'PA' =\u0026gt; 'PA' ,'RI' =\u0026gt; 'RI' ,'SC' =\u0026gt; 'SC' ,'SD' =\u0026gt; 'SD' ,'TN' =\u0026gt; 'TN' ,'TX' =\u0026gt; 'TX' ,'UT' =\u0026gt; 'UT' ,'VT' =\u0026gt; 'VT' ,'VA' =\u0026gt; 'VA' ,'WA' =\u0026gt; 'WA' ,'WV' =\u0026gt; 'WV' ,'WI' =\u0026gt; 'WI' ,'WY' =\u0026gt; 'WY' ) ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'chosen-select' ,'data-placeholder' =\u0026gt; 'Choose a State' ) )); ?\u0026gt; \u0026lt;script\u0026gt; jQuery(document).ready(function () { jQuery(\u0026quot;.chosen-select\u0026quot;).chosen({ search_contains: true, no_results_text: \u0026quot;Nothing found for: \u0026quot;, width: \u0026quot;100%\u0026quot;, }); }); \u0026lt;/script\u0026gt; "
},
{
"uri": "https://piklist.github.io/docs/tutorials/fields/using-select2/",
"title": "Using "Select2" for select fields",
"tags": [],
"description": "Select2 is a jQuery replacement for select boxes, and can easily be used with Piklist",
"content": "Description Piklist makes it easy to create select boxes, but sometimes they can become long with tons of options. Using the \u0026ldquo;Select2\u0026rdquo; jQuery plugin can make them more user-friendly.\n First, let\u0026rsquo;s load two files from Select2. Their javascript and css file. Though the javascript is mandatory, the css is not. You can just borrow from this file if you want. In your theme\u0026rsquo;s functions.php file, or your main plugin file add this code:\nfunction my_enqueue_files() { wp_enqueue_style( 'select2_styles', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css', false ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'select2_js', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js', array('jquery'), null, true ); } add_action( 'wp_enqueue_scripts', 'my_enqueue_files' ); Note: for backend (admin) pages like a post editor, use admin_enqueue_scripts action hook instead:\nadd_action( 'admin_enqueue_scripts', 'my_enqueue_files' ); Now let\u0026rsquo;s add a select field with lots of options. Add this field to the proper file in your /parts folder: piklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'us_states' ,'label' =\u0026gt; 'Select a state' ,'required' =\u0026gt; true ,'choices' =\u0026gt; array( '' =\u0026gt; '' ,'AL' =\u0026gt; 'AL' ,'AK' =\u0026gt; 'AK' ,'AZ' =\u0026gt; 'AZ' ,'AR' =\u0026gt; 'AR' ,'CA' =\u0026gt; 'CA' ,'CO' =\u0026gt; 'CO' ,'CT' =\u0026gt; 'CT' ,'DE' =\u0026gt; 'DE' ,'DC' =\u0026gt; 'DC' ,'FL' =\u0026gt; 'FL' ,'GA' =\u0026gt; 'GA' ,'HI' =\u0026gt; 'HI' ,'ID' =\u0026gt; 'ID' ,'IL' =\u0026gt; 'IL' ,'IN' =\u0026gt; 'IN' ,'IA' =\u0026gt; 'IA' ,'KS' =\u0026gt; 'KS' ,'KY' =\u0026gt; 'KY' ,'LA' =\u0026gt; 'LA' ,'ME' =\u0026gt; 'ME' ,'MD' =\u0026gt; 'MD' ,'MA' =\u0026gt; 'MA' ,'MI' =\u0026gt; 'MI' ,'MN' =\u0026gt; 'MN' ,'MS' =\u0026gt; 'MS' ,'MO' =\u0026gt; 'MO' ,'MT' =\u0026gt; 'MT' ,'NE' =\u0026gt; 'NE' ,'NV' =\u0026gt; 'NV' ,'NH' =\u0026gt; 'NH' ,'NJ' =\u0026gt; 'NJ' ,'NM' =\u0026gt; 'NM' ,'NY' =\u0026gt; 'NY' ,'NC' =\u0026gt; 'NC' ,'ND' =\u0026gt; 'ND' ,'OH' =\u0026gt; 'OH' ,'OK' =\u0026gt; 'OK' ,'OR' =\u0026gt; 'OR' ,'PA' =\u0026gt; 'PA' ,'RI' =\u0026gt; 'RI' ,'SC' =\u0026gt; 'SC' ,'SD' =\u0026gt; 'SD' ,'TN' =\u0026gt; 'TN' ,'TX' =\u0026gt; 'TX' ,'UT' =\u0026gt; 'UT' ,'VT' =\u0026gt; 'VT' ,'VA' =\u0026gt; 'VA' ,'WA' =\u0026gt; 'WA' ,'WV' =\u0026gt; 'WV' ,'WI' =\u0026gt; 'WI' ,'WY' =\u0026gt; 'WY' ) ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'select2-select' ,'style' =\u0026gt; 'width: 50%' ,'data-placeholder' =\u0026gt; 'Choose a State' ) )); Let\u0026rsquo;s take a closer look at this field:\nUnder attributes, we\u0026rsquo;ve assigned:\n 'class' =\u0026gt; 'select2-select': This can be any class you want, but it will allow the Select2 JS to convert this field. 'style' =\u0026gt; 'width: 50%': Setting the width of the field. 'data-placeholder' =\u0026gt; 'Choose a State': Set placeholder text. Notice we also set the first choice as empty. This is necessary so Select2 can apply the placeholder.\n Last, we need to add some jQuery and pass Select2 options. You can find a full list of options here.\nYou can enqueue this code in a separate file, or if you like, you can include it in the same file as your field code:\n\u0026lt;script\u0026gt; jQuery(document).ready(function() { jQuery('.select2-select').select2({ placeholder: \u0026quot;Select a state\u0026quot; }); }); \u0026lt;/script\u0026gt; IMPORTANT: notice that we\u0026rsquo;ve included the class select2-select, from the field code, in the jQuery script. This tells Select2 which field you want to convert.\n Full Code Snippet: \u0026lt;?php /* Title: Select Fields Post Type: post */ piklist('field', array( 'type' =\u0026gt; 'select' ,'field' =\u0026gt; 'us_states' ,'label' =\u0026gt; 'Select a state' ,'required' =\u0026gt; true ,'choices' =\u0026gt; array( '' =\u0026gt; '' ,'AL' =\u0026gt; 'AL' ,'AK' =\u0026gt; 'AK' ,'AZ' =\u0026gt; 'AZ' ,'AR' =\u0026gt; 'AR' ,'CA' =\u0026gt; 'CA' ,'CO' =\u0026gt; 'CO' ,'CT' =\u0026gt; 'CT' ,'DE' =\u0026gt; 'DE' ,'DC' =\u0026gt; 'DC' ,'FL' =\u0026gt; 'FL' ,'GA' =\u0026gt; 'GA' ,'HI' =\u0026gt; 'HI' ,'ID' =\u0026gt; 'ID' ,'IL' =\u0026gt; 'IL' ,'IN' =\u0026gt; 'IN' ,'IA' =\u0026gt; 'IA' ,'KS' =\u0026gt; 'KS' ,'KY' =\u0026gt; 'KY' ,'LA' =\u0026gt; 'LA' ,'ME' =\u0026gt; 'ME' ,'MD' =\u0026gt; 'MD' ,'MA' =\u0026gt; 'MA' ,'MI' =\u0026gt; 'MI' ,'MN' =\u0026gt; 'MN' ,'MS' =\u0026gt; 'MS' ,'MO' =\u0026gt; 'MO' ,'MT' =\u0026gt; 'MT' ,'NE' =\u0026gt; 'NE' ,'NV' =\u0026gt; 'NV' ,'NH' =\u0026gt; 'NH' ,'NJ' =\u0026gt; 'NJ' ,'NM' =\u0026gt; 'NM' ,'NY' =\u0026gt; 'NY' ,'NC' =\u0026gt; 'NC' ,'ND' =\u0026gt; 'ND' ,'OH' =\u0026gt; 'OH' ,'OK' =\u0026gt; 'OK' ,'OR' =\u0026gt; 'OR' ,'PA' =\u0026gt; 'PA' ,'RI' =\u0026gt; 'RI' ,'SC' =\u0026gt; 'SC' ,'SD' =\u0026gt; 'SD' ,'TN' =\u0026gt; 'TN' ,'TX' =\u0026gt; 'TX' ,'UT' =\u0026gt; 'UT' ,'VT' =\u0026gt; 'VT' ,'VA' =\u0026gt; 'VA' ,'WA' =\u0026gt; 'WA' ,'WV' =\u0026gt; 'WV' ,'WI' =\u0026gt; 'WI' ,'WY' =\u0026gt; 'WY' ) ,'attributes' =\u0026gt; array( 'class' =\u0026gt; 'select2-select' ,'style' =\u0026gt; 'width: 50%' ,'data-placeholder' =\u0026gt; 'Choose a State' ) )); ?\u0026gt; \u0026lt;script\u0026gt; jQuery(document).ready(function() { jQuery('.select2-select').select2({ placeholder: \u0026quot;Select a state\u0026quot; }); }); \u0026lt;/script\u0026gt; "
},
{
"uri": "https://piklist.github.io/docs/fields/types/week/",
"title": "week Field",
"tags": [],
"description": "",
"content": "'type' =\u0026gt; 'week' This is an HTML5 field\npiklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;week\u0026#39;, \u0026#39;field\u0026#39; =\u0026gt; \u0026#39;my_field\u0026#39;, \u0026#39;label\u0026#39; =\u0026gt; \u0026#39;my field\u0026#39;, )); "
},
{
"uri": "https://piklist.github.io/docs/tutorials/widgets/",
"title": "Widgets",
"tags": [],
"description": "Tutorials on Widgets",
"content": "Tutorials Easy Widgets\nBuilding widgets with Piklist is incredibly simple. You can use a fraction of the code WordPress requires to make very powerful widgets.\n "
},
{
"uri": "https://piklist.github.io/docs/tutorials/workflows/",
"title": "Workflow Tabs",
"tags": [],
"description": "Tutorials on Workflow Tabs",
"content": "Tutorials Building Your First Workflow\nPiklist Workflows allow you to add a tabbed system on Post and User. Additionally, you can add almost anything you want to each tab.\n Adding SubTabs to Workflows\nPiklist Workflow tabs can be enhanced with subtabs.\n Placing \u0026#34;Add New Post\u0026#34; in a Workflow\nUse the Workflows to divide the default WordPress add new Post page.\n "
},
{
"uri": "https://piklist.github.io/docs/tutorials/relationships/working-with-field-relationships/",
"title": "Working with Field Relationships",
"tags": [],
"description": "Piklist allows you to relate any object to any object.",
"content": "Piklist relationships allow you to relate any object to any object.\nIn this tutorial we\u0026rsquo;ll use the classic books example, assuming our post types are book and chapter, and a user can be an author. We\u0026rsquo;ll cover the post_has, post_belongs, and relate_query parameters.\nFirst let\u0026rsquo;s add the chapter relate field to the book post type. Since this is a post type we\u0026rsquo;re adding a field to, the file goes in the /parts/meta-boxes/ folder.\nCreate a file and add this code:\n/** * Title: Chapters * Post Type: book * Context: normal * Priority: high */ piklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;select\u0026#39; ,\u0026#39;title\u0026#39; =\u0026gt; \u0026#39;Chapters\u0026#39; ,\u0026#39;choices\u0026#39; =\u0026gt; piklist(get_posts(array( \u0026#39;numberposts\u0026#39; =\u0026gt; -1 ,\u0026#39;post_type\u0026#39; =\u0026gt; \u0026#39;chapters\u0026#39; )), array(\u0026#39;ID\u0026#39;, \u0026#39;post_title\u0026#39;)) ,\u0026#39;relate\u0026#39; =\u0026gt; array( \u0026#39;scope\u0026#39; =\u0026gt; \u0026#39;post\u0026#39; ) ,\u0026#39;attributes\u0026#39; =\u0026gt; array( \u0026#39;multiple\u0026#39; =\u0026gt; \u0026#39;multiple\u0026#39; ) )); Create a second file in the /parts/user/ folder. Now let\u0026rsquo;s add the books relate field to the author:\n/** * Title: Books * Capability: edit_books */ piklist(\u0026#39;field\u0026#39;, array( \u0026#39;type\u0026#39; =\u0026gt; \u0026#39;select\u0026#39; ,\u0026#39;title\u0026#39; =\u0026gt; \u0026#39;Books\u0026#39; ,\u0026#39;choices\u0026#39; =\u0026gt; piklist(get_posts(array( \u0026#39;numberposts\u0026#39; =\u0026gt; -1 ,\u0026#39;post_type\u0026#39; =\u0026gt; \u0026#39;books\u0026#39; )), array(\u0026#39;ID\u0026#39;, \u0026#39;post_title\u0026#39;)) ,\u0026#39;relate\u0026#39; =\u0026gt; array( \u0026#39;scope\u0026#39; =\u0026gt; \u0026#39;post\u0026#39; ) ,\u0026#39;attributes\u0026#39; =\u0026gt; array( \u0026#39;multiple\u0026#39; =\u0026gt; \u0026#39;multiple\u0026#39; ) )); Querying data by relationships Like most parts of Piklist, you can use standard WordPress functions to retrieve your data. Relationships are not different.\nImportant Note: When using the get_posts() function make sure ou include 'suppress_filters' =\u0026gt; false, otherwise WordPress won\u0026rsquo;t allow Piklist to extend the function. WP_Query allows filters by default.\nGet a book\u0026rsquo;s chapters:\n$chapters = get_posts(array( \u0026#39;post_type\u0026#39; =\u0026gt; \u0026#39;chapter\u0026#39; ,\u0026#39;numberposts\u0026#39; =\u0026gt; -1 ,\u0026#39;suppress_filters\u0026#39; =\u0026gt; false ,\u0026#39;relate_query\u0026#39; =\u0026gt; array( array( \u0026#39;id\u0026#39; =\u0026gt; $book_id ,\u0026#39;relate\u0026#39; =\u0026gt; \u0026#39;belongs\u0026#39; ) ) )); Here\u0026rsquo;s a shorthand method, which has the same result and works for simple queries. There\u0026rsquo;s also a post_belongs counterpart.\n$chapters = get_posts(array( \u0026#39;post_type\u0026#39; =\u0026gt; \u0026#39;chapter\u0026#39; ,\u0026#39;numberposts\u0026#39; =\u0026gt; -1 ,\u0026#39;suppress_filters\u0026#39; =\u0026gt; false ,\u0026#39;post_belongs\u0026#39; =\u0026gt; $book_id )); Get an author\u0026rsquo;s books:\n$books = get_posts(array( \u0026#39;post_type\u0026#39; =\u0026gt; \u0026#39;book\u0026#39; ,\u0026#39;numberposts\u0026#39; =\u0026gt; -1 ,\u0026#39;suppress_filters\u0026#39; =\u0026gt; false ,\u0026#39;relate_query\u0026#39; =\u0026gt; array( array( \u0026#39;id\u0026#39; =\u0026gt; $user_id ,\u0026#39;scope\u0026#39; =\u0026gt; \u0026#39;user\u0026#39; ,\u0026#39;relate\u0026#39; =\u0026gt; \u0026#39;has\u0026#39; ) ) )); Please note that we\u0026rsquo;re including scope in the relate array but I didn\u0026rsquo;t in the first example. This is because in the first example the scope is the same for both objects. I could put 'scope' =\u0026gt; 'post', but it\u0026rsquo;s unnecessary.\nGet either books' authors\n$authors = get_users(array( \u0026#39;relate_query\u0026#39; =\u0026gt; array( \u0026#39;compare\u0026#39; =\u0026gt; \u0026#39;OR\u0026#39; ,array( \u0026#39;id\u0026#39; =\u0026gt; $book_one_id ,\u0026#39;scope\u0026#39; =\u0026gt; \u0026#39;post\u0026#39; ,\u0026#39;relate\u0026#39; =\u0026gt; \u0026#39;belongs\u0026#39; ) ,array( \u0026#39;id\u0026#39; =\u0026gt; $book_two_id ,\u0026#39;scope\u0026#39; =\u0026gt; \u0026#39;post\u0026#39; ,\u0026#39;relate\u0026#39; =\u0026gt; \u0026#39;belongs\u0026#39; ) ) )); To get an author that has both books, you would simply change 'compare' =\u0026gt; 'OR' to 'compare' =\u0026gt; 'AND' – and this is not case sensitive.\nAdvanced example of getting books that belong to ( Author 1 AND Author 2 ) OR Author 3:\n$books = get_posts(array( \u0026#39;post_type\u0026#39; =\u0026gt; \u0026#39;book\u0026#39; ,\u0026#39;numberposts\u0026#39; =\u0026gt; -1 ,\u0026#39;suppress_filters\u0026#39; =\u0026gt; false ,\u0026#39;relate_query\u0026#39; =\u0026gt; array( \u0026#39;compare\u0026#39; =\u0026gt; \u0026#39;OR\u0026#39; ,array( \u0026#39;compare\u0026#39; =\u0026gt; \u0026#39;AND\u0026#39; ,array( \u0026#39;id\u0026#39; =\u0026gt; $user_one_id ,\u0026#39;scope\u0026#39; =\u0026gt; \u0026#39;user\u0026#39; ,\u0026#39;relate\u0026#39; =\u0026gt; \u0026#39;has\u0026#39; ) \u0026#39;id\u0026#39; =\u0026gt; $user_two_id ,\u0026#39;scope\u0026#39; =\u0026gt; \u0026#39;user\u0026#39; ,\u0026#39;relate\u0026#39; =\u0026gt; \u0026#39;has\u0026#39; ) ) ,array( \u0026#39;id\u0026#39; =\u0026gt; $user_three_id ,\u0026#39;scope\u0026#39; =\u0026gt; \u0026#39;user\u0026#39; ,\u0026#39;relate\u0026#39; =\u0026gt; \u0026#39;has\u0026#39; ) ) )); How relationships are stored Let’s talk about how relate data is stored for a moment. In our case we have a book post type relating to a chapter post type. As mentioned, in this case the book owns the chapter; that is to say, when creating a book the user selects which chapters will be in it — makes sense!\nThe way Piklist stores this is that in the chapter’s meta it adds a __relate_post meta key wherein the value is the ID of the event that owns it. This is later used when performing relate queries.\nSo if you look at the book’s meta, you won’t see anything added about the chapter. Why? Because it’s not designed to put anything there. Look at the chapter’s meta. You should find it there. For this reason, you don’t need to specify a field, as relate fields are a special type which store in their own way. In short, the owned object stores the meta.\nNote: we\u0026rsquo;re talking about two post types, here. In the case of a user that owns a post type, the post type would have __relate_user in the meta. The possibilities are __relate_post, __relate_user, and __relate_comment.\n"
}]