forked from netmix/radio-station
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathradio-station.php
3094 lines (2739 loc) · 104 KB
/
radio-station.php
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
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* @package Radio Station
* @version 2.3.3.7
*/
/*
Plugin Name: Radio Station
Plugin URI: https://netmix.com/radio-station
Description: Adds Show pages, DJ role, playlist and on-air programming functionality to your site.
Author: Tony Zeoli, Tony Hayes
Version: 2.3.3.8
Text Domain: radio-station
Domain Path: /languages
Author URI: https://netmix.com/radio-station
GitHub Plugin URI: netmix/radio-station
Copyright 2019 Digital Strategy Works (email : [email protected])
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// === Setup ===
// - Define Plugin Constants
// - Define Plugin Data Slugs
// - Include Plugin Files
// - Plugin Options and Defaults
// - Plugin Loader Settings
// - Start Plugin Loader Instance
// - Include Plugin Admin Files
// - Load Plugin Text Domain
// - Check Plugin Version
// - Flush Rewrite Rules
// - Enqueue Plugin Script
// - Enqueue Plugin Stylesheet
// - Localize Time Strings
// === Template Filters ===
// - Get Template
// - Station Phone Number Filter
// - Automatic Pages Content Filter
// - Single Content Template Filter
// - Show Content Template Filter
// - Playlist Content Template Filter
// - Override Content Template Filter
// - DJ / Host / Producer Template Fix
// - Get DJ / Host Template
// - Get Producer Template
// - Single Template Hierarchy
// - Single Templates Loader
// - Archive Template Hierarchy
// x Archive Templates Loader
// - Add Links Back to Show
// - Show Posts Adjacent Links
// === Query Filters ===
// - Playlist Archive Query Filter
// === User Roles ===
// - Set Roles and Capabilities
// - maybe Revoke Edit Show Capability
// === Debugging ===
// - Set Debug Mode Constant
// - maybe Clear Transient Data
// - Debug Output and Logging
// -------------
// === Setup ===
// -------------
// -----------------------
// Define Plugin Constants
// -----------------------
// 2.3.1: added constant for Netmix Directory
define( 'RADIO_STATION_FILE', __FILE__ );
define( 'RADIO_STATION_DIR', dirname( __FILE__ ) );
define( 'RADIO_STATION_BASENAME', plugin_basename( __FILE__ ) );
define( 'RADIO_STATION_HOME_URL', 'https://netmix.com/radio-station/' );
define( 'RADIO_STATION_DOCS_URL', 'https://netmix.com/radio-station/docs/' );
define( 'RADIO_STATION_API_DOCS_URL', 'https://netmix.com/radio-station/docs/api/' );
define( 'RADIO_STATION_PRO_URL', 'https://netmix.com/radio-station-pro/' );
define( 'RADIO_STATION_NETMIX_DIR', 'https://netmix.com/' );
// ------------------------
// Define Plugin Data Slugs
// ------------------------
define( 'RADIO_STATION_LANGUAGES_SLUG', 'rs-languages' );
define( 'RADIO_STATION_HOST_SLUG', 'rs-host' );
define( 'RADIO_STATION_PRODUCER_SLUG', 'rs-producer' );
// --- check and define CPT slugs ---
// TODO: prefix original slugs and update post/taxonomy data
// ... and then add new slugs to template hierarchy ...
if ( get_option( 'radio_show_cpts_prefixed' ) ) {
define( 'RADIO_STATION_SHOW_SLUG', 'rs-show' );
define( 'RADIO_STATION_PLAYLIST_SLUG', 'rs-playlist' );
define( 'RADIO_STATION_OVERRIDE_SLUG', 'rs-override' );
define( 'RADIO_STATION_GENRES_SLUG', 'rs-genres' );
} else {
define( 'RADIO_STATION_SHOW_SLUG', 'show' );
define( 'RADIO_STATION_PLAYLIST_SLUG', 'playlist' );
define( 'RADIO_STATION_OVERRIDE_SLUG', 'override' );
define( 'RADIO_STATION_GENRES_SLUG', 'genres' );
}
// --------------------
// Include Plugin Files
// --------------------
// 2.3.0: include new data feeds file
// 2.3.0: renamed widget files to match new widget names
// 2.3.0: separate file for legacy support functions
// --- Main Includes ---
require RADIO_STATION_DIR . '/includes/post-types.php';
require RADIO_STATION_DIR . '/includes/support-functions.php';
require RADIO_STATION_DIR . '/includes/data-feeds.php';
require RADIO_STATION_DIR . '/includes/legacy.php';
// --- Shortcodes ---
require RADIO_STATION_DIR . '/includes/master-schedule.php';
require RADIO_STATION_DIR . '/includes/shortcodes.php';
// --- Widgets ---
require RADIO_STATION_DIR . '/includes/class-current-show-widget.php';
require RADIO_STATION_DIR . '/includes/class-upcoming-shows-widget.php';
require RADIO_STATION_DIR . '/includes/class-current-playlist-widget.php';
require RADIO_STATION_DIR . '/includes/class-radio-clock-widget.php';
// --- Feature Development ---
// 2.3.0: add feature branch development includes
// 2.3.1: added radio player widget file
$features = array( 'class-radio-player-widget', 'import-export' );
foreach ( $features as $feature ) {
$filepath = RADIO_STATION_DIR . '/includes/' . $feature . '.php';
if ( file_exists ( $filepath ) ) {
include $filepath;
}
}
// --- Player ---
// 2.3.1.1: load radio player prototype (if present)
$player_file = RADIO_STATION_DIR . '/player/radio-player.php';
if ( file_exists( $player_file ) ) {
require $player_file;
}
// ---------------------------
// Plugin Options and Defaults
// ---------------------------
// 2.3.0: added plugin options
$timezones = radio_station_get_timezone_options( true );
$languages = radio_station_get_language_options( true );
$formats = radio_station_get_stream_formats();
$options = array(
// === Broadcast ===
// --- Streaming URL ---
'streaming_url' => array(
'type' => 'text',
'options' => 'URL',
'label' => __( 'Streaming URL', 'radio-station' ),
'default' => '',
'helper' => __( 'Enter the Streaming URL for your Radio Station. This will be discoverable via Data Feeds and used in the upcoming Radio Player.', 'radio-station' ),
'tab' => 'general',
'section' => 'broadcast',
),
// --- Stream Format ---
'streaming_format' => array(
'type' => 'select',
'options' => $formats,
'label' => __( 'Streaming Format', 'radio-station' ),
'default' => 'aac',
'helper' => __( 'Select streaming format for streaming URL.', 'radio-station' ),
'tab' => 'general',
'section' => 'broadcast',
),
// --- Fallback Stream URL ---
'fallback_url' => array(
'type' => 'text',
'options' => 'URL',
'label' => __( 'Fallback Stream URL', 'radio-station' ),
'default' => '',
'helper' => __( 'Enter an alternative Streaming URL for Player fallback.', 'radio-station' ),
'tab' => 'general',
'section' => 'broadcast',
),
// --- Fallback Stream Format ---
'fallback_format' => array(
'type' => 'select',
'options' => $formats,
'label' => __( 'Fallback Format', 'radio-station' ),
'default' => 'ogg',
'helper' => __( 'Select streaming fallback for fallback URL.', 'radio-station' ),
'tab' => 'general',
'section' => 'broadcast',
),
// --- Main Radio Language ---
'radio_language' => array(
'type' => 'select',
'options' => $languages,
'label' => __( 'Main Broadcast Language', 'radio-station' ),
'default' => '',
'helper' => __( 'Select the main language used on your Radio Station.', 'radio-station' ),
'tab' => 'general',
'section' => 'broadcast',
),
// === Station ===
// --- Station Title ---
// 2.3.3.8: added station title field
'station_title' => array(
'type' => 'text',
'label' => __( 'Station Title', 'radio-station' ),
'default' => '',
'helper' => __( 'Name of your Radio Station. For use in Stream Player and Data Feeds.', 'radio-station' ),
'tab' => 'general',
'section' => 'station',
),
// --- Station Image ---
// 2.3.3.8: added station logo image field
'station_image' => array(
'type' => 'image',
'label' => __( 'Station Logo Image', 'radio-station' ),
'default' => '',
'helper' => __( 'Add a logo image for your Radio Station. Please ensure image is square before uploading. Recommended size 256 x 256', 'radio-station' ),
'tab' => 'general',
'section' => 'station',
),
// --- Timezone Location ---
'timezone_location' => array(
'type' => 'select',
'options' => $timezones,
'label' => __( 'Location Timezone', 'radio-station' ),
'default' => '',
'helper' => __( 'Select your Broadcast Location for Radio Timezone display.', 'radio-station' ),
'tab' => 'general',
'section' => 'station',
),
// --- Clock Time Format ---
'clock_time_format' => array(
'type' => 'select',
'options' => array(
'12' => __( '12 Hour Format', 'radio-station' ),
'24' => __( '24 Hour Format', 'radio-station' ),
),
'label' => __( 'Clock Time Format', 'radio-station' ),
'default' => '12',
'helper' => __( 'Default Time Format for display output. Can be overridden in each shortcode or widget.', 'radio-station' ),
'tab' => 'general',
'section' => 'station',
),
// --- Station Phone Number ---
// 2.3.3.6: added station phone number option
'station_phone' => array(
'type' => 'text',
'options' => 'PHONE',
'label' => __( 'Station Phone', 'radio-station' ),
'default' => '',
'helper' => __( 'Main call in phone number for the Station (for requests etc.)', 'radio-station' ),
'tab' => 'general',
'section' => 'station',
),
// --- Phone for Shows ---
// 2.3.3.6: added default to station phone option
'shows_phone' => array(
'type' => 'checkbox',
'default' => '',
'value' => 'yes',
'label' => __( 'Show Phone Display', 'radio-station' ),
'helper' => __( 'Display Station phone number on Shows where a Show phone number is not set.', 'radio-station' ),
'tab' => 'general',
'section' => 'station',
),
// --- Station Email Address ---
// 2.3.3.8: added station email address option
'station_email' => array(
'type' => 'email',
'default' => '',
'label' => __( 'Station Email', 'radio-station' ),
'helper' => __( 'Main email address for the Station (for requests etc.)', 'radio-station' ),
'tab' => 'general',
'section' => 'station',
),
// --- Email for Shows ---
// 2.3.3.8: added default to email address option
'shows_email' => array(
'type' => 'checkbox',
'default' => '',
'value' => 'yes',
'label' => __( 'Show Email Display', 'radio-station' ),
'helper' => __( 'Display Station email address on Shows where a Show email address is not set.', 'radio-station' ),
'tab' => 'general',
'section' => 'station',
),
// === Feeds ===
// --- REST Data Routes ---
'enable_data_routes' => array(
'type' => 'checkbox',
'label' => __( 'Enable Data Routes', 'radio-station' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Enables Station Data Routes via WordPress REST API.', 'radio-station' ),
'tab' => 'general',
'section' => 'feeds',
),
// --- Data Feed Links ---
'enable_data_feeds' => array(
'type' => 'checkbox',
'label' => __( 'Enable Data Feeds', 'radio-station' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Enable Station Data Feeds via WordPress Feed links.', 'radio-station' ),
'tab' => 'general',
'section' => 'feeds',
),
// --- Ping Netmix Directory ---
// note: disabled by default for WordPress.org repository compliance
'ping_netmix_directory' => array(
'type' => 'checkbox',
'label' => __( 'Ping Netmix Directory', 'radio-station' ),
'default' => '',
'value' => 'yes',
'helper' => __( 'If you have a Netmix Directory listing, enable this to ping the directory whenever you update your schedule.', 'radio-station' ),
'tab' => 'general',
'section' => 'feeds',
),
// --- Clear Transients ---
'clear_transients' => array(
'type' => 'checkbox',
'label' => __( 'Clear Transients', 'radio-station' ),
'default' => '',
'value' => 'yes',
'helper' => __( 'Clear Schedule transients with every pageload. Less efficient but more reliable.', 'radio-station' ),
'tab' => 'general',
'section' => 'feeds',
),
// --- Transient Caching ---
'transient_caching' => array(
'type' => 'checkbox',
'label' => __( 'Show Transients', 'radio-station' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Use Show Transient Data to improve Schedule calculation performance.', 'radio-station' ),
'tab' => 'general',
'section' => 'feeds',
'pro' => true,
),
// --- Show Shift Feeds ---
/* 'show_shift_feeds' => array(
'type' => 'checkbox',
'label' => __( 'Show Shift Feeds', 'radio-station' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Convert RSS Feeds for a single Show to a Show shift feed, allowing a visitor to subscribe to a Show feed to be notified of Show shifts.', 'radio-station' ),
'tab' => 'general',
'section' => 'feeds',
'pro' => true,
), */
// === Basic Stream Player ===
// TODO: add note about these defaults being overrideable in widgets
// --- Player Title ---
'player_title' => array (
'type' => 'checkbox',
'label' => __( 'Display Station Title', 'radio-station' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Display your Radio Station Title in Player by default.', 'radio-station' ),
'tab' => 'player',
'section' => 'basic',
'pro' => false,
),
// --- Player Image ---
'player_image' => array(
'type' => 'checkbox',
'label' => __( 'Display Station Image', 'radio-station' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Display your Radio Station Image in Player by default.', 'radio-station' ),
'tab' => 'player',
'section' => 'basic',
'pro' => false,
),
// --- Player Script ---
'player_script' => array(
'type' => 'select',
'label' => __( 'Player Script', 'radio-station' ),
'default' => 'amplitude',
'options' => array(
'amplitude' => __( 'Amplitude', 'radio-station' ),
'howler' => __( 'Howler', 'radio-station' ),
'jplayer' => __( 'jPlayer', 'radio-station' ),
),
'helper' => __( 'Default Script to use for Radio Streaming Player.', 'radio-station' ),
'tab' => 'player',
'section' => 'basic',
'pro' => false,
),
// --- Player Theme ---
'player_theme' => array(
'type' => 'select',
'label' => __( 'Default Player Theme', 'radio-station' ),
'default' => 'light',
'options' => array(
'light' => __( 'Light', 'radio-station' ),
'dark' => __( 'Dark', 'radio-station' ),
),
'helper' => __( 'Default Player Controls theme style.', 'radio-station' ),
'tab' => 'player',
'section' => 'basic',
'pro' => false,
),
// --- Player Buttons ---
'player_buttons' => array(
'type' => 'select',
'label' => __( 'Default Player Buttons', 'radio-station' ),
'default' => 'rounded',
'options' => array(
'circular' => __( 'Circular Buttons', 'radio-station' ),
'rounded' => __( 'Rounded Buttons', 'radio-station' ),
'square' => __( 'Square Buttons', 'radio-station' ),
),
'helper' => __( 'Default Player Buttons shape style.', 'radio-station' ),
'tab' => 'player',
'section' => 'basic',
'pro' => false,
),
// --- Player Debug Mode ---
'player_debug' => array(
'type' => 'checkbox',
'label' => __( 'Player Debug Mode', 'radio-station' ),
'default' => '',
'value' => 'yes',
'helper' => __( 'Output player debug information in browser console.', 'radio-station' ),
'tab' => 'player',
'section' => 'basic',
'pro' => false,
),
// === Player Colours ===
// --- [Pro] Playing Highlight Color ---
'player_playing_color' => array(
'type' => 'color',
'label' => __( 'Playing Icon Highlight Color', 'radio-station' ),
'default' => '#70E070',
'helper' => __( 'Default highlight color to use for Play button icon when playing.', 'radio-station' ),
'tab' => 'player',
'section' => 'colors',
'pro' => true,
),
// --- [Pro] Control Icons Highlight Color ---
'player_buttons_color' => array(
'type' => 'color',
'label' => __( 'Control Icons Highlight Color', 'radio-station' ),
'default' => '#00A0E0',
'helper' => __( 'Default highlight color to use for Control buttons when active.', 'radio-station' ),
'tab' => 'player',
'section' => 'colors',
'pro' => true,
),
// --- [Pro] Volume Knob Color ---
'player_thumb_color' => array(
'type' => 'color',
'label' => __( 'Volume Knob Color', 'radio-station' ),
'default' => '#80C080',
'helper' => __( 'Default Knob Color for Player Volume Slider.', 'radio-station' ),
'tab' => 'player',
'section' => 'colors',
'pro' => true,
),
// --- [Pro] Volume Track Color ---
'player_range_color' => array(
'type' => 'coloralpha',
'label' => __( 'Volume Track Color', 'radio-station' ),
'default' => '#80C080',
'helper' => __( 'Default Track Color for Player Volume Slider.', 'radio-station' ),
'tab' => 'player',
'section' => 'colors',
'pro' => true,
),
// === Advanced Stream Player ===
// --- Player Volume ---
'player_volume' => array(
'type' => 'number',
'label' => __( 'Player Start Volume', 'radio-station' ),
'default' => 77,
'min' => 0,
'step' => 1,
'max' => 100,
'helper' => __( 'Initial volume for when the Player starts playback.', 'radio-station' ),
'tab' => 'player',
'section' => 'advanced',
'pro' => false,
),
// --- Single Player ---
'player_single' => array(
'type' => 'checkbox',
'label' => __( 'Single Player at Once', 'radio-station' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Stop any existing Players on the page or in other windows or tabs when a Player is started.', 'radio-station' ),
'tab' => 'player',
'section' => 'advanced',
'pro' => false,
),
// --- [Pro] Player Autoresume ---
'player_autoresume' => array(
'type' => 'checkbox',
'label' => __( 'Autoresume Playback', 'radio-station' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Attempt to resume playback if visitor was playing. Only triggered when the user first interacts with the page.', 'radio-station' ),
'tab' => 'player',
'section' => 'advanced',
'pro' => true,
),
// --- [Pro] Popup Player Window ---
/* 'player_popup' => array(
'type' => 'checkbox',
'label' => __( 'Popup Player Window', 'radio-station' ),
'default' => '',
'value' => 'yes',
'helper' => __( 'Add a popup icon to your Player to open it in a separate window.', 'radio-station' ),
'tab' => 'player',
'section' => 'advanced',
'pro' => true,
), */
// === Sitewide Player Bar ===
// --- Player Bar Note ---
'player_bar_note' => array(
'type' => 'note',
'label' => __( 'Bar Defaults Note', 'radio-station' ),
'helper' => __( 'The Bar Player uses the default configurations set above.', 'radio-station' )
. ' ' . __( 'You can override these in specific Player Widgets.', 'radio-station' ),
'tab' => 'player',
'section' => 'bar',
// 'pro' => true,
),
// --- [Pro] Sitewide Player Bar ---
'player_bar' => array(
'type' => 'select',
'label' => __( 'Sitewide Player Bar', 'radio-station' ),
'default' => 'off',
'options' => array(
'off' => __( 'No Player Bar', 'radio-station' ),
'top' => __( 'Top Player Bar', 'radio-station' ),
'bottom' => __( 'Bottom Player Bar', 'radio-station' ),
),
'tab' => 'player',
'section' => 'bar',
'helper' => __( 'Add a fixed position Player Bar which displays Sitewide.', 'radio-station' ),
'pro' => true,
),
// --- [Pro] Fade In Player Bar ---
'player_bar_fadein' => array(
'type' => 'number',
'label' => __( 'Fade In Player Bar', 'radio-station' ),
'default' => 2500,
'min' => 0,
'step' => 100,
'max' => 10000,
'helper' => __( 'Number of milliseconds after Page load over which to fade in Player Bar. Use 0 for instant display.', 'radio-station' ),
'tab' => 'player',
'section' => 'bar',
'pro' => true,
),
// --- [Pro] Continuous Playback ---
'player_bar_continuous' => array(
'type' => 'checkbox',
'label' => __( 'Continuous Playback', 'radio-station' ),
'default' => 'yes',
'helper' => __( 'Uninterrupted Sitewide Bar playback while user is navigating between pages! Pages are loaded in background and faded in while Player Bar persists.', 'radio-station' ),
'tab' => 'player',
'section' => 'bar',
'pro' => true,
),
// --- [Pro] Player Page Fade ---
'player_bar_pagefade' => array(
'type' => 'number',
'label' => __( 'Fade In Player Bar', 'radio-station' ),
'default' => 2000,
'min' => 0,
'step' => 100,
'max' => 10000,
'helper' => __( 'Number of milliseconds over which to fade in new Pages when continuous playback is enabled. Use 0 for instant display.', 'radio-station' ),
'tab' => 'player',
'section' => 'bar',
'pro' => true,
),
// --- [Pro] Bar Player Text Color ---
'player_bar_text' => array(
'type' => 'color',
'label' => __( 'Bar Player Text Color', 'radio-station' ),
'default' => '#FFFFFF',
'helper' => __( 'Text color for the fixed position Sitewide Bar Player.', 'radio-station' ),
'tab' => 'player',
'section' => 'bar',
'pro' => true,
),
// --- [Pro] Bar Player Background Color ---
'player_bar_background' => array(
'type' => 'coloralpha',
'label' => __( 'Bar Player Background Color', 'radio-station' ),
'default' => 'rgba(0,0,0,255)',
'helper' => __( 'Background color for the fixed position Sitewide Bar Player.', 'radio-station' ),
'tab' => 'player',
'section' => 'bar',
'pro' => true,
),
// TODO: additional CSS input field ?
// === Master Schedule Page ===
// --- Schedule Page ---
'schedule_page' => array(
'type' => 'select',
'options' => 'PAGEID',
'label' => __( 'Master Schedule Page', 'radio-station' ),
'default' => '',
'helper' => __( 'Select the Page you are displaying the Master Schedule on.', 'radio-station' ),
'tab' => 'pages',
'section' => 'schedule',
),
// --- Automatic Schedule Display ---
'schedule_auto' => array(
'type' => 'checkbox',
'label' => __( 'Automatic Display', 'radio-station' ),
'default' => 'yes',
'value' => 'yes',
'helper' => __( 'Replaces selected page content with Master Schedule. Alternatively customize with the shortcode: ', 'radio-station' ) . ' [master-schedule]',
'tab' => 'pages',
'section' => 'schedule',
),
// --- Default Schedule View ---
'schedule_view' => array(
'type' => 'select',
'label' => __( 'Schedule View Default', 'radio-station' ),
'default' => 'table',
'options' => array(
'table' => __( 'Table View', 'radio-station' ),
'list' => __( 'List View', 'radio-station' ),
'div' => __( 'Divs View', 'radio-station' ),
'tabs' => __( 'Tabbed View', 'radio-station' ),
'default' => __( 'Legacy Table', 'radio-station' ),
),
'helper' => __( 'View type to use for automatic display on Master Schedule Page.', 'radio-station' ),
'tab' => 'pages',
'section' => 'schedule',
),
// --- Schedule Clock Display ---
'schedule_clock' => array(
'type' => 'select',
'label' => __( 'Schedule Clock?', 'radio-station' ),
'default' => 'clock',
'options' => array(
'' => __( 'None', 'radio-station' ),
'clock' => __( 'Clock', 'radio-station' ),
'timezone' => __( 'Timezone', 'radio-station' ),
),
'helper' => __( 'Radio Time section display above program Schedule.', 'radio-station' ),
'tab' => 'pages',
'section' => 'schedule',
),
// --- [Pro] Schedule Switcher ---
'schedule_switcher' => array(
'type' => 'checkbox',
'label' => __( 'View Switching', 'radio-station' ),
'default' => '',
'value' => 'yes',
'helper' => __( 'Enable View Switching on the Master Schedule.', 'radio-station' ),
'tab' => 'pages',
'section' => 'schedule',
'pro' => true,
),
// --- [Pro] Available Views ===
// 2.3.2: added additional views option
'schedule_views' => array(
'type' => 'multicheck',
'label' => __( 'Available Views', 'radio-station' ),
// note: unstyled list view not included in defaults
'default' => array( 'table', 'tabs' ),
'value' => 'yes',
'options' => array(
'table' => __( 'Table View', 'radio-station' ),
'tabs' => __( 'Tabbed View', 'radio-station' ),
'list' => __( 'List View', 'radio-station' ),
// 'grid' => __( 'Grid View', 'radio-station' ),
// 'calendar' => __( 'Calendar View', 'radio-station' );
),
'helper' => __( 'Switcher Views available on Master Schedule.', 'radio-station' ),
'tab' => 'pages',
'section' => 'schedule',
'pro' => true,
),
// === Show Page ===
// --- Show Blocks Position ---
'show_block_position' => array(
'type' => 'select',
'label' => __( 'Info Blocks Position', 'radio-station' ),
'options' => array(
'left' => __( 'Float Left', 'radio-station' ),
'right' => __( 'Float Right', 'radio-station' ),
'top' => __( 'Float Top', 'radio-station' ),
),
'default' => 'left',
'helper' => __( 'Where to position Show info blocks relative to Show Page content.', 'radio-station' ),
'tab' => 'pages',
'section' => 'show',
),
// ---- Show Section Layout ---
'show_section_layout' => array(
'type' => 'select',
'label' => __( 'Show Content Layout', 'radio-station' ),
'options' => array(
'tabbed' => __( 'Tabbed', 'radio-station' ),
'standard' => __( 'Standard', 'radio-station' ),
),
'default' => 'tabbed',
'helper' => __( 'How to display extra sections below Show description. In content tabs or standard layout down the page.', 'radio-station' ),
'tab' => 'pages',
'section' => 'show',
),
// --- Show Header Image ---
// 2.3.2: added plural to option label
'show_header_image' => array(
'type' => 'checkbox',
'label' => __( 'Content Header Images', 'radio-station' ),
'value' => 'yes',
'default' => '',
'helper' => __( 'If your chosen template does not display the Featured Image, enable this and use the Content Header Image box on the Show edit screen instead.', 'radio-station' ),
'tab' => 'pages',
'section' => 'show',
),
// --- Latest Show Posts ---
// 'show_latest_posts' => array(
// 'type' => 'numeric',
// 'label' => __( 'Latest Show Posts', 'radio-station' ),
// 'step' => 1,
// 'min' => 0,
// 'max' => 100,
// 'default' => 3,
// 'helper' => __( 'Number of Latest Blog Posts to Show above Show Page tabs.', 'radio-station' ),
// 'tab' => 'pages',
// 'section' => 'show',
// ),
// --- Show Posts Per Page ---
'show_posts_per_page' => array(
'type' => 'numeric',
'label' => __( 'Posts per Page', 'radio-station' ),
'step' => 1,
'min' => 0,
'max' => 1000,
'default' => 10,
'helper' => __( 'Linked Show Posts per page on the Show Page tab/display.', 'radio-station' ),
'tab' => 'pages',
'section' => 'show',
),
// --- Show Playlists per Page ---
'show_playlists_per_page' => array(
'type' => 'numeric',
'step' => 1,
'min' => 0,
'max' => 1000,
'label' => __( 'Playlists per Page', 'radio-station' ),
'default' => 10,
'helper' => __( 'Playlists per page on the Show Page tab/display', 'radio-station' ),
'tab' => 'pages',
'section' => 'show',
),
// --- [Pro] Show Episodes per Page ---
// 'show_episodes_per_page' => array(
// 'type' => 'number',
// 'label' => __( 'Episodes per Page', 'radio-station' ),
// 'step' => 1,
// 'min' => 1,
// 'max' => 1000,
// 'default' => 10,
// 'helper' => __( 'Number of Show Episodes per page on the Show page tab/display.', 'radio-station' ),
// 'tab' => 'pages',
// 'section' => 'show',
// 'pro' => true,
// ),
// ==== Archives ===
// --- Shows Archive Page ---
'show_archive_page' => array(
'label' => __( 'Shows Archive Page', 'radio-station' ),
'type' => 'select',
'options' => 'PAGEID',
'default' => '',
'helper' => __( 'Select the Page for displaying the Show archive list.', 'radio-station' ),
'tab' => 'pages',
'section' => 'archives',
),
// --- Automatic Display ---
'show_archive_auto' => array(
'label' => __( 'Automatic Display', 'radio-station' ),
'type' => 'checkbox',
'value' => 'yes',
'default' => 'yes',
'helper' => __( 'Replaces selected page content with default Show Archive. Alternatively customize display using the shortcode:', 'radio-station' ) . ' [shows-archive]',
'tab' => 'pages',
'section' => 'archives',
),
// ? --- Redirect Shows Archive --- ?
// 'show_archive_override' => array(
// 'label' => __( 'Redirect Shows Archive', 'radio-station' ),
// 'type' => 'checkbox',
// 'value' => 'yes',
// 'default' => '',
// 'helper' => __( 'Redirect Custom Post Type Archive for Shows to Shows Archive Page.', 'radio-station' ),
// 'tab' => 'pages',
// 'section' => 'archives',
// ),
// --- Overrides Archive Page ---
'override_archive_page' => array(
'label' => __( 'Overrides Archive Page', 'radio-station' ),
'type' => 'select',
'options' => 'PAGEID',
'default' => '',
'helper' => __( 'Select the Page for displaying the Override archive list.', 'radio-station' ),
'tab' => 'pages',
'section' => 'archives',
),
// --- Automatic Display ---
'override_archive_auto' => array(
'label' => __( 'Automatic Display', 'radio-station' ),
'type' => 'checkbox',
'value' => 'yes',
'default' => 'yes',
'helper' => __( 'Replaces selected page content with default Override Archive. Alternatively customize display using the shortcode:', 'radio-station' ) . ' [overrides-archive]',
'tab' => 'pages',
'section' => 'archives',
),
// ? --- Redirect Overrides Archive --- ?
// 'override_archive_override' => array(
// 'label' => __( 'Redirect Overrides Archive', 'radio-station' ),
// 'type' => 'checkbox',
// 'value' => 'yes',
// 'default' => '',
// 'helper' => __( 'Redirect Custom Post Type Archive for Overrides to Overrides Archive Page.', 'radio-station' ),
// 'tab' => 'pages',
// 'section' => 'archives',
// ),
// --- Playlists Archive Page ---
'playlist_archive_page' => array(
'label' => __( 'Playlists Archive Page', 'radio-station' ),
'type' => 'select',
'options' => 'PAGEID',
'default' => '',
'helper' => __( 'Select the Page for displaying the Playlist archive list.', 'radio-station' ),
'tab' => 'pages',
'section' => 'archives',
),
// --- Automatic Display ---
'playlist_archive_auto' => array(
'label' => __( 'Automatic Display', 'radio-station' ),
'type' => 'checkbox',
'value' => 'yes',
'default' => 'yes',
'helper' => __( 'Replaces selected page content with default Playlist Archive. Alternatively customize display using the shortcode:', 'radio-station' ) . ' [playlists-archive]',
'tab' => 'pages',
'section' => 'archives',
),
// ? --- Redirect Playlists Archive --- ?
// 'playlist_archive_override' => array(
// 'label' => __( 'Redirect Playlists Archive', 'radio-station' ),
// 'type' => 'checkbox',
// 'value' => 'yes',
// 'default' => '',
// 'helper' => __( 'Redirect Custom Post Type Archive for Playlists to Playlist Archive Page.', 'radio-station' ),
// 'tab' => 'pages',
// 'section' => 'archives',
// ),
// --- Genres Archive Page ---
'genre_archive_page' => array(
'label' => __( 'Genres Archive Page', 'radio-station' ),
'type' => 'select',
'options' => 'PAGEID',
'default' => '',
'helper' => __( 'Select the Page for displaying the Genre archive list.', 'radio-station' ),
'tab' => 'pages',
'section' => 'archives',
),
// --- Automatic Display ---
'genre_archive_auto' => array(
'label' => __( 'Automatic Display', 'radio-station' ),
'type' => 'checkbox',
'value' => 'yes',
'default' => 'yes',
'helper' => __( 'Replaces selected page content with default Genre Archive. Alternatively customize display using the shortcode:', 'radio-station' ) . ' [genres-archive]',
'tab' => 'pages',
'section' => 'archives',
),
// ? --- Redirect Genres Archives --- ?
// 'genre_archive_override' => array(
// 'label' => __( 'Redirect Genres Archive', 'radio-station' ),
// 'type' => 'checkbox',
// 'value' => 'yes',
// 'default' => '',
// 'helper' => __( 'Redirect Taxonomy Archive for Genres to Genres Archive Page.', 'radio-station' ),
// 'tab' => 'pages',
// 'section' => 'archives',
// ),
// === Single Templates ===
// --- Templates Change Note ---
'templates_change_note' => array(
'type' => 'note',
'label' => __( 'Templates Change Note', 'radio-station' ),
'helper' => __( 'Since 2.3.0, the way that Templates are implemented has changed.', 'radio-station' )
. ' ' . __( 'See the Documentation for more information:', 'radio-station' )
. ' <a href="' . RADIO_STATION_DOCS_URL . 'display/#page-templates" target="_blank">' . __( 'Templates Documentation', 'radio-station' ) . '</a>',
'tab' => 'pages',
'section' => 'single',
),