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
| <?php
| //PLUGIN STRUCTURE
| // /content/
| // art.php
| // design.php
| // development.php
| // setup.php
| // strategy.php
| // writing.php
| // /dashboard/
| // setup.php
| // /files/
| // fileManagement.php
| // /forms/
| // setup.php
| // /login/
| // setup.php
| // /taxonomies/
| // city.php
| // form.php
| // media.php
| // progress.php
| // setup.php
| // style.php
| // target.php
| // theme.php
| // /users/
| // client.php
| // setup.php
| // ajakevan.php <-- main plugin file
|
| if (!defined('ABSPATH')) {
| exit;
| }
|
| use JVBase\managers\CacheManager;
|
| add_filter('jvb_base', function () {
| return 'altr_';
| });
|
|
| const AJV_DIR = WP_PLUGIN_DIR . '/ajakevan';
| define('AJV_URL', plugin_dir_url(__FILE__));
|
| require(AJV_DIR . '/content/setup.php');
| //require(AJV_DIR . '/dashboard/setup.php');
| //require(AJV_DIR . '/forms/setup.php');
| require(AJV_DIR . '/login/setup.php');
| require(AJV_DIR . '/taxonomies/setup.php');
| //require(AJV_DIR . '/users/setup.php');
| //require(AJV_DIR . '/files/fileManagement.php');
|
|
| /**
| * Defines base options like:
| * - directory & Membership
| * - dashboard
| * - membership settings (JVB_MEMBERSHIP)
| * - post types (JVB_CONTENT)
| * - taxonomies (JVB_TAXONOMY)
| * - User Roles (JVB_USER)
| * - enthusiast = (bool) short form for a subscriber-like user that can collect content for reference
| * - forum = (bool) create a forum
| * - member_only = (bool) if forum and this is true, creates a member-only forum in the custom dashboard
| *
| * as well as central filters for
| * - rewrite rules
| * - archive title
| */
| add_filter('jvb_site', 'altr_setup_site');
| function altr_setup_site(): array
| {
| return [
| 'icons' => 'light',
| 'is_directory' => false, //as in, a membership directory
| 'has_membership' => false,
| 'has_map' => true,
| 'dashboard' => true,
| 'has_support' => true,
| 'use_feed_block' => true,
| 'email_notifications' => true,
| 'integrations' => [
| 'bluesky' => true,
| 'cloudflare' => true,
| 'facebook' => false,
| 'maps' => true,
| 'gmb' => true,
| 'helcim' => false,
| 'instagram' => false,
| 'square' => true,
| 'umami' => true,
| ],
| // 'is_restaurant' => false,
| // 'limit_hours' => false,
| // 'enthusiast' => true,
| // 'favourites' => true, //optional flag to allow enthusiasts, but not favourites
| ];
| }
|
| /**
| * JVB_MEMBERSHIP defines the structure of the directory
| * Options include:
| * - membership_expires = useful if members pay a yearly membership fee
| * - hide_expired = removes users once membership expired; only used if membership_expires is true
| * - clip_expired = keeps users once membership expires, but limits the information shown; only used if membership_expires is true
| * - membership_approval = verified users can approve other users
| * - term_approval = (bool) verified users can create new terms, but needs approval
| * - member_only = (array) if empty, open to any registered user. otherwise an array of registered user roles
| */
| //add_filter('jvb_membership', 'altr_setup_membership');
| //function altr_setup_membership():array
| //{
| // return [
| // 'member_content' => true,
| // 'can_invite' => ['artist' => ['artist']],
| // 'member_verified' => true,
| // 'notifications' => true,
| // 'forum' => true,
| // 'member_only' => [ 'artist' ],
| // 'member_expires' => false,
| // 'hide_expired' => false,
| // 'clip_expired' => false,
| // 'term_approval' => true,
| // 'can_approve' => [ 'artist' ]
| // ];
| //}
|
| add_filter('jvbLoadingQuips', 'altr_loading_quips');
| function altr_loading_quips(array $quips): array
| {
| return [];
| }
|
|
| // /content/art.php
| function altr_art(): array
| {
| return [
| 'singular' => 'Art',
| 'plural' => 'Art',
| 'dash_title' => 'Art',
| 'dash_description' => 'Manage your art posts',
| 'breadcrumb' => 'Art',
| 'hide_single' => false,
| 'show_feed' => true,
| 'favouritable' => true,
| 'karma' => false,
| 'icon' => 'artwork',
| 'rewrite' => [
| 'slug' => 'art',
| 'with_front' => false,
| ],
| 'fields' => [
| 'post_title' => [
| 'type' => 'text',
| 'label' => 'Title',
| ],
| 'featured_image' => [
| 'type' => 'image',
| 'label' => 'Image',
| ],
| 'gallery' => [
| 'type' => 'gallery',
| 'label' => 'Gallery',
| ],
| 'price' => [
| 'type' => 'number',
| 'label' => 'Price',
| ],
| 'post_content' => [
| 'type' => 'textarea',
| 'quill' => true,
| 'label' => 'Notes'
| ]
| ],
| 'single_image' => false,
| 'upload_title' => 'Upload Artwork',
| ];
| }
|
|
| // /content/design.php
| function altr_design(): array
| {
| return [
| 'singular' => 'Graphic Design',
| 'plural' => 'Designs',
| 'hide_single' => false,
| 'redirectToAuthor' => false,
| 'show_feed' => true,
| 'favouritable' => true,
| 'karma' => false,
| 'icon' => 'artwork',
| 'rewrite' => [
| 'slug' => 'design',
| 'with_front' => false,
| ],
| 'fields' => [
| 'post_title' => [
| 'type' => 'text',
| 'label' => 'Title',
| ],
| 'featured_image' => [
| 'type' => 'image',
| 'label' => 'Image',
| ],
| 'gallery' => [
| 'type' => 'gallery',
| 'label' => 'Gallery',
| ],
| 'price' => [
| 'type' => 'number',
| 'label' => 'Price',
| ],
| 'post_content' => [
| 'type' => 'textarea',
| 'quill' => true,
| 'label' => 'Notes'
| ]
| ],
| 'single_image' => false,
| 'upload_title' => 'Upload Artwork',
| ];
| }
|
|
| // /content/development.php
| function altr_development(): array
| {
| return [
| 'singular' => 'Development',
| 'plural' => 'Developments',
| 'hide_single' => false,
| 'redirectToAuthor' => false,
| 'show_feed' => true,
| 'favouritable' => true,
| 'karma' => false,
| 'icon' => 'brackets-angle',
| 'rewrite' => [
| 'slug' => 'development',
| 'with_front' => false,
| ],
| 'fields' => [
| 'post_title' => [
| 'type' => 'text',
| 'label' => 'Title',
| ],
| 'featured_image' => [
| 'type' => 'image',
| 'label' => 'Image',
| ],
| 'gallery' => [
| 'type' => 'gallery',
| 'label' => 'Gallery',
| ],
| 'price' => [
| 'type' => 'number',
| 'label' => 'Price',
| ],
| 'post_content' => [
| 'type' => 'textarea',
| 'quill' => true,
| 'label' => 'Notes'
| ]
| ],
| 'single_image' => false,
| 'upload_title' => 'Upload Artwork',
| ];
| }
|
|
| // /content/setup.php
|
| /**
| * JVB_CONTENT: Base post type definitions
| * Structure: [ 'slug' => [$options], ]
| * Note: slug is prepended with BASE in registration
| * $options includes:
| * - any $args from register_post_type
| * - single and plural labels (string)
| * - hide_single = (bool) if true, only show posts on author page, not on is_singular() view
| * - show_feed = (bool) if true, becomes one of the content types shown in feed block
| * - show_directory= (bool) if true, creates an alphabetical list directory page
| * - karma = (bool) if true, sets up upvotes/downvotes system
| * - favouritable = (bool)
| * - responses = (bool) if true, sets up comments and replies
| * - is_calendar = (bool) if true, sets up default calendar functionality
| * - single_image = (bool) if true, and dashboard is setup, each image becomes its own post
| * - upload_title = (string)),
| * - rewrites = (array) key = associated taxonomy; value = what to append to rewrite base
| * - description = (array) strings for login description of type
| * -dash_title = (string) customize the title for custom dashboard
| * - dash_description = (string) customize the description for custom dashboard
| * - directory_extra = (array) of BASEless slugs of taxonomies to link in directory
| * - sections = (array) 'slug' => $options, where options include ['label' => $label, 'icon' => $iconSlug]; used to split large groups of fields into tabs on the edit page
| * - fields = (array) of fields, as defined in Meta.php, as well as additional options:
| * - 'quickEdit' => (bool) whether this field can be edited in the custom administrator dashboard (best for text fields)
| * - 'section' => (string) the slug of the section, as defined above
| */
|
| require(AJV_DIR . '/content/art.php');
| require(AJV_DIR . '/content/design.php');
| require(AJV_DIR . '/content/development.php');
| require(AJV_DIR . '/content/strategy.php');
| require(AJV_DIR . '/content/support.php');
| require(AJV_DIR . '/content/writing.php');
|
| add_filter('jvb_content', 'altr_content');
| function altr_content($content): array
| {
| return [
| 'design' => altr_design(),
| 'development' => altr_development(),
| 'strategy' => altr_strategy(),
| 'art' => altr_art(),
| 'writing' => altr_writing(),
| 'support' => altr_support(),
| ];
| }
|
|
| // /content/strategy.php
| function altr_strategy(): array
| {
| return [
| 'singular' => 'Strategy',
| 'plural' => 'Strategies',
| 'hide_single' => false,
| 'redirectToAuthor' => false,
| 'show_feed' => true,
| 'favouritable' => true,
| 'karma' => false,
| 'icon' => 'brain',
| 'rewrite' => [
| 'slug' => 'strategy',
| 'with_front' => false,
| ],
| 'fields' => [
| 'post_title' => [
| 'type' => 'text',
| 'label' => 'Title',
| ],
| 'featured_image' => [
| 'type' => 'image',
| 'label' => 'Image',
| ],
| 'gallery' => [
| 'type' => 'gallery',
| 'label' => 'Gallery',
| ],
| 'price' => [
| 'type' => 'number',
| 'label' => 'Price',
| ],
| 'post_content' => [
| 'type' => 'textarea',
| 'quill' => true,
| 'label' => 'Notes'
| ]
| ],
| 'single_image' => false,
| 'upload_title' => 'Upload Artwork',
| ];
| }
|
|
| // /content/support.php
| function altr_support(): array
| {
| return [
| 'singular' => 'Support',
| 'plural' => 'Support',
| 'hide_single' => false,
| 'show_feed' => false,
| 'icon' => 'life-ring',
| 'rewrite' => [
| 'slug' => 'support',
| 'with_front' => false,
| ],
| 'fields' => [
| 'post_title' => [
| 'type' => 'text',
| 'label' => 'Title',
| ],
| 'post_content' => [
| 'type' => 'textarea',
| 'quill' => true,
| 'label' => 'Content'
| ]
| ],
| ];
| }
|
|
| // /content/writing.php
| function altr_writing(): array
| {
| return [
| 'singular' => 'Writing',
| 'plural' => 'Writings',
| 'hide_single' => false,
| 'redirectToAuthor' => false,
| 'show_feed' => true,
| 'favouritable' => true,
| 'karma' => false,
| 'icon' => 'pen-nib',
| 'rewrite' => [
| 'slug' => 'writing',
| 'with_front' => false,
| ],
| 'fields' => [
| 'post_title' => [
| 'type' => 'text',
| 'label' => 'Title',
| ],
| 'featured_image' => [
| 'type' => 'image',
| 'label' => 'Image',
| ],
| 'gallery' => [
| 'type' => 'gallery',
| 'label' => 'Gallery',
| ],
| 'price' => [
| 'type' => 'number',
| 'label' => 'Price',
| ],
| 'post_content' => [
| 'type' => 'textarea',
| 'quill' => true,
| 'label' => 'Notes'
| ]
| ],
| 'single_image' => false,
| 'upload_title' => 'Upload Artwork',
| ];
| }
|
|
| // /login/setup.php
| add_filter('jvb_login', 'altr_setup_login');
| function altr_setup_login(): array
| {
| return [
| 'login_from_favourite_header' => 'Join the scene; <small>keep your collection.</small>',
| 'login_header' => 'Log in',
| 'join_header' => 'Join in',
| 'from_favourites_benefits' => [
| 'Save designs you love',
| 'Get personalized recommendations',
| 'Connect with artists',
| 'Build your inspiration collection',
| 'Bonus: It\'s all free!'
| ]
| ];
| }
|
|
| // /taxonomies/city.php
| function altr_city(): array
| {
| return [
| 'singular' => 'City',
| 'plural' => 'Cities',
| 'icon' => 'city',
| 'description' => [
| 'From Edmonton, yes - but also throughout Alberta.'
| ],
| 'show_feed' => true,
| 'show_directory' => true,
| 'approve_new' => false,
| 'rewrite' => [
| 'slug' => 'in',
| 'with_front' => false,
| 'hierarchical' => true,
| ],
| 'hierarchical' => true,
| 'for_content' => [
| 'art',
| 'design',
| 'development',
| 'strategy',
| 'writing',
| ],
| 'fields' => [
| 'term_name' => [
| 'label' => 'Name',
| 'type' => 'text',
| 'quickEdit' => true,
| ],
| 'common' => ['wiki']
| ]
| ];
| }
|
| // /taxonomies/form.php
| function altr_form(): array
| {
| return [
| 'singular' => 'Form',
| 'plural' => 'Forms',
| 'description' => [
| 'From paintings to sculptures.'
| ],
| 'icon' => 'shapes',
| 'show_feed' => true,
| 'show_directory' => false,
| 'approve_new' => false,
| 'rewrite' => [
| 'slug' => 'form',
| 'with_front' => false,
| ],
| 'for_content' => [
| 'art',
| 'design',
| ],
| 'fields' => [
| 'term_name' => [
| 'label' => 'Name',
| 'type' => 'text',
| 'quickEdit' => true,
| ],
| 'common' => ['wiki']
| ]
| ];
| }
|
| // /taxonomies/media.php
| function altr_media(): array
| {
| return [
| 'singular' => 'Medium',
| 'plural' => 'Media',
| 'description' => [
| '<b>What it\'s made of.</b>',
| 'From clay to oil paints'
| ],
| 'icon' => 'media',
| 'show_feed' => true,
| 'show_directory' => true,
| 'approve_new' => true,
| 'rewrite' => [
| 'slug' => 'media',
| 'with_front' => false,
| 'hierarchical' => true,
| ],
| 'hierarchical' => true,
| 'for_content' => [
| 'art'
| ],
| 'fields' => [
| 'term_name' => [
| 'label' => 'Name',
| 'type' => 'text',
| 'quickEdit' => true,
| ],
| 'common' => ['wiki']
| ]
| ];
| }
|
| // /taxonomies/progress.php
| function altr_progress(): array
| {
| return [
| 'singular' => 'Progress',
| 'plural' => 'Progress',
| 'icon' => 'circle-notch',
| 'show_feed' => true,
| 'show_directory' => true,
| 'approve_new' => false,
| 'rewrite' => [
| 'slug' => 'progress',
| 'with_front' => false,
| 'hierarchical' => true,
| ],
| 'hierarchical' => true,
| 'for_content' => [
| 'art',
| 'design',
| 'development',
| 'strategy',
| 'writing',
| ],
| 'fields' => [
| 'term_name' => [
| 'label' => 'Name',
| 'type' => 'text',
| 'quickEdit' => true,
| ],
| 'common' => ['wiki']
| ]
| ];
| }
|
| // /taxonomies/setup.php
| /**
| * JVB_TAXONOMY : defines the custom taxonomies
| * structure: slug => [$options]
| * Note: slug is prepended with BASE
| * $options includes:
| * - any $args from register_taxonomy
| * - (string) singular and plural labels
| * - show_feed = (bool) whether to show in feed block
| * - show_directory = (bool) whether to output a directory for this taxonomy
| * - is_content = (bool) if true, sets it up to be more like a content type, but collects other content types
| * - is_ownable = (bool) if true, allows defined users to manage
| * - karma = (bool) if true, sets up upvotes/downvotes system
| * - verify_entry = (bool) if true, users not already attached to this taxonomy need to be approved before entry.
| * - approve_new = (bool) if true, admin/verified users need to approve before 'live'
| * - track_changes = (bool) if true, table is created to track historical changes
| * - for_content = (array) of post type slugs, as defined in JVB_CONTENT
| * - fields = (array) of custom field definitions, from inc/managers/Meta.php
| * -> add use_in_stats (bool) to use the field in user statistics
| */
|
| require(AJV_DIR . '/taxonomies/city.php');
| require(AJV_DIR . '/taxonomies/form.php');
| require(AJV_DIR . '/taxonomies/media.php');
| require(AJV_DIR . '/taxonomies/progress.php');
| require(AJV_DIR . '/taxonomies/style.php');
| require(AJV_DIR . '/taxonomies/target.php');
| require(AJV_DIR . '/taxonomies/theme.php');
|
| add_filter('jvb_taxonomy', 'altr_taxonomy');
| function altr_taxonomy(): array
| {
| return [
| 'city' => altr_city(),
| 'style' => altr_style(),
| 'theme' => altr_theme(),
| 'form' => altr_form(),
| 'medium' => altr_media(),
| 'target' => altr_target(),
| 'progress' => altr_progress(),
| ];
| }
|
| // /taxonomies/style.php
| function altr_style(): array
| {
| return [
| 'directory' => 'Styles',
| 'description' => [
| 'From American Traditional to Japanese.'
| ],
| 'singular' => 'Style',
| 'plural' => 'Styles',
| 'show_directory' => true,
| 'approve_new' => false,
| 'icon' => 'folder',
| 'favouritable' => true,
| 'show_feed' => true,
| 'rewrite' => [
| 'slug' => 'style',
| 'with_front' => false,
| 'hierarchical' => true,
| ],
| 'hierarchical' => true,
| 'for_content' => [
| 'art',
| 'design',
| 'development',
| 'strategy',
| 'writing',
| ],
| 'fields' => [
| 'term_name' => [
| 'label' => 'Name',
| 'type' => 'text',
| 'quickEdit' => true,
| ],
| 'common' => ['wiki', 'alternate_name', 'keywords']
| ]
| ];
| }
|
| // /taxonomies/target.php
| function altr_target(): array
| {
| return [
| 'singular' => 'Target Audience',
| 'plural' => 'Target Audiences',
| 'icon' => 'crosshair-simple',
| 'show_feed' => false,
| 'rewrite' => [
| 'slug' => 'target',
| 'with_front' => false,
| 'hierarchical' => true,
| ],
| 'hierarchical' => true,
| 'for_content' => [
| 'art',
| 'design',
| 'development',
| 'strategy',
| 'writing',
| ],
| 'fields' => [
| 'term_name' => [
| 'label' => 'Name',
| 'type' => 'text',
| 'quickEdit' => true,
| ],
| 'common' => ['wiki']
| ]
| ];
| }
|
| // /taxonomies/theme.php
| function altr_theme(): array
| {
| return [
| 'directory' => 'Themes',
| 'show_directory' => true,
| 'isGrouped' => true,
| 'description' => [
| 'What makes up the tattoo, asides from style.',
| 'From bees to ideas to carrots.'
| ],
| 'singular' => 'Theme',
| 'plural' => 'Themes',
| 'icon' => 'hash',
| 'favouritable' => true,
| 'show_feed' => true,
| 'approve_new' => false,
| 'rewrite' => [
| 'slug' => 'themes',
| 'with_front' => false,
| 'hierarchical' => true,
| ],
| 'hierarchical' => true,
| 'for_content' => [
| 'art',
| 'design',
| 'development',
| 'strategy',
| 'writing',
| ],
| 'fields' => [
| 'term_name' => [
| 'label' => 'Name',
| 'type' => 'text',
| 'quickEdit' => true,
| ],
| 'similar' => [
| 'type' => 'taxonomy',
| 'taxonomy_type' => 'reference',
| 'taxonomy' => 'theme',
| 'label' => 'Similar Themes',
| ],
| 'description' => [
| 'type' => 'textarea',
| 'quill' => true,
| 'label' => 'Description',
| ],
| 'archive_title' => [
| 'type' => 'text',
| 'label' => 'Archive Title',
| 'description' => 'If the generated title does not jive, set it here',
| ],
| 'common' => ['wiki', 'alternate_name', 'keywords']
| ]
| ];
| }
|
|
| // /users/client.php
| function altr_user_client(): array
| {
| return [
| 'label' => 'Client',
| 'has_dashboard' => true,
| 'can_create' => ['support'],
| 'can_register' => true,
| 'keep_stats' => true,
| 'join_text' => 'Save your favourites. Get Notified.',
| 'join_title' => 'Welcome to the Scene.',
| 'join_description' => [
| 'Save your favourites for easy access',
| 'Get notified when your favourite artists add new content',
| 'Stay in the loop with local flash days and events',
| 'Discover styles and artists that match your vision'
| ],
| 'join_bonus' => '<strong>BONUS: </strong>Everything\'s free. And always will be. We work with partners vetted by the community to keep the lights on.',
| ];
| }
|
| // /users/enthusiast.php
| function altr_user_enthusiast(): array
| {
| return [
| 'label' => 'Enthusiast',
| 'has_dashboard' => true,
| 'can_create' => [],
| 'can_register' => true,
| 'keep_stats' => true,
| 'join_text' => 'Save your favourites. Get Notified.',
| 'join_title' => 'Welcome to the Scene.',
| 'join_description' => [
| 'Save your favourites for easy access',
| 'Get notified when your favourite artists add new content',
| 'Stay in the loop with local flash days and events',
| 'Discover styles and artists that match your vision'
| ],
| 'join_bonus' => '<strong>BONUS: </strong>Everything\'s free. And always will be. We work with partners vetted by the community to keep the lights on.',
| ];
| }
|
|
| // /users/setup.php
| /**
| * JVB_USER -> defines user roles. Mainly for Dashboard/Directory sites
| * Structure: slug => $options
| * Note: slug is prepended with BASE
| * $options includes:
| * - has_dashboard = user has access to custom dashboard
| * - can_create = (array) of post types and taxonomies they can create
| * --> Optionally, if the user is split between types (example: tattoo artist vs piercer), you can define types here.
| * ex: [
| * ['tattoo-artist' => ['tattoo', 'artwork']],
| * ['piercer' => ['piercing', 'artwork']],
| * ]
| * - manage_others = (array) of post types this role can manage other users items
| * - can_register = (bool) if true, this user can self register
| * - profile = (string) associated post type to treat as archive page, as registered in JVB_CONTENT
| * - register_fields = (array) of field names available in registration, as defined in settings OR associated profile JVB_CONTENT
| * - approve_new = (bool) if true, user content is hidden until verified by admin/other verified users
| * - keep_stats = (bool) if true, creates a statistics table that tracks how much content is created per user per day
| * - settings = (array) of fields users can modify
| * - admin = (array) of fields admin/moderators can modify, attached to user
| * - register = (array) of field names as defined in settings that are on registration, if can_register === true
| * - description = (array|string) if an array, each item in array will be it's own paragraph
| * -> description of the user role. Used in the registration page
| */
|
| require(AJV_DIR . '/users/client.php');
| require(AJV_DIR . '/users/enthusiast.php');
|
| add_filter('jvb_user', 'altr_user');
|
| function altr_user():array
| {
| return [
| 'enthusiast' => altr_user_enthusiast(),
| 'client' => altr_user_client(),
| ];
| }
|
|