forked from Rundiz-WP/bootstrap-basic4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshortcodes.php
More file actions
82 lines (64 loc) · 2.62 KB
/
shortcodes.php
File metadata and controls
82 lines (64 loc) · 2.62 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
<?php
//Create the shortcodes.
function gpt_get_candidate_title(){
return get_option('green_party_candidate_title');
}
function gpt_get_candidate_location(){
return get_option('green_party_candidate_location');
}
function gpt_get_candidate_ballotStatus(){
return get_option('green_party_candidate_ballotStatus');
}
function gpt_get_candidate_onBallot(){
return get_option('green_party_candidate_onBallot');
}
function gpt_get_candidate_endorsed(){
return get_option('green_party_candidate_endorsed');
}
function gpt_get_candidate_result(){
return get_option('green_party_candidate_result');
}
function gpt_get_organization_type(){
return get_option('organization_organizatin_type');
}
function gpt_get_eventsPageURL(){
return get_option('organization_eventsPageURL');
}
function gpt_get_discord_volunteer_channel_URL(){
return get_option('organization_discord_volunteer_channel_URL');
}
function gpt_get_donationsPageURL(){
return get_option('donationsPageURL');
}
function gpt_get_register_to_vote_URL(){
return get_option('organization_register_to_vote_URL');
}
function gpt_get_video(){
return get_option('organization_video');
}
function gptAddAllShortCodes(){
add_shortcode ('video', 'gpt_get_video');
add_shortcode('candidate_title', 'gpt_get_candidate_title');
add_shortcode('candidate_location', 'gpt_get_candidate_location');
add_shortcode('candidate_ballotStatus', 'gpt_get_candidate_ballotStatus');
add_shortcode('candidate_onBallot', 'gpt_get_candidate_onBallot');
add_shortcode('candidate_endorsed', 'gpt_get_candidate_endorsed');
add_shortcode('candidate_result', 'gpt_get_candidate_result');
add_shortcode('organization_type','gpt_get_organization_type');
add_shortcode('eventsPageURL', 'gpt_get_eventsPageURL');
add_shortcode ('discord_volunteer_channel_URL',
'gpt_get_discord_volunteer_channel_URL');
add_shortcode ('donationsPageURL','gpt_get_donationsPageURL');
add_shortcode('register_to_vote_URL','gpt_get_register_to_vote_URL');
}
// Enable shortcodes for menu navigation.
if ( ! has_filter( 'wp_nav_menu', 'shortcode_unautop' ) ) {
add_filter( 'wp_nav_menu', 'shortcode_unautop' );
}
if ( ! has_filter( 'wp_nav_menu', 'do_shortcode' ) ) {
add_filter( 'wp_nav_menu', 'do_shortcode', 11 );
}
if ( ! has_action('switch_theme', 'gptAddAllShortCodes')){
add_action('switch_theme', 'gptAddAllShortCodes');
}
?>