-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
137 lines (116 loc) · 3.12 KB
/
functions.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
<?php
/*
* BrandSpa (http://brandspa.com)
* Alejandro Sanabria <[email protected]>
* Copyright 2016 BrandSpa
*/
register_nav_menus(
array(
'header' => __('Header nav'),
)
);
include_once 'shortcodes/index.php';
include_once 'shortcodes/slider.php';
include_once 'shortcodes/donate.php';
include_once 'shortcodes/donate_vertical.php';
include_once 'shortcodes/donate_react.php';
include_once 'shortcodes/contact.php';
include_once 'shortcodes/help_form.php';
include_once 'options/index.php';
include_once 'apis/index.php';
include_once 'lib/index.php';
include_once 'lib/infusionsoft.php';
function enqueue_scripts()
{
wp_enqueue_media();
wp_enqueue_script( 'app_script', get_template_directory_uri() . '/public/js/admin.js',array(), '4', true );
}
add_action('admin_enqueue_scripts', 'enqueue_scripts');
function my_mce4_options( $init ) {
$default_colours = '
"000000", "Black",
"993300", "Burnt orange",
"333300", "Dark olive",
"003300", "Dark green",
"003366", "Dark azure",
"000080", "Navy Blue",
"333399", "Indigo",
"333333", "Very dark gray",
"800000", "Maroon",
"FF6600", "Orange",
"808000", "Olive",
"008000", "Green",
"008080", "Teal",
"0000FF", "Blue",
"666699", "Grayish blue",
"808080", "Gray",
"FF0000", "Red",
"FF9900", "Amber",
"99CC00", "Yellow green",
"339966", "Sea green",
"33CCCC", "Turquoise",
"3366FF", "Royal blue",
"800080", "Purple",
"999999", "Medium gray",
"FF00FF", "Magenta",
"FFCC00", "Gold",
"FFFF00", "Yellow",
"00FF00", "Lime",
"00FFFF", "Aqua",
"00CCFF", "Sky blue",
"993366", "Brown",
"C0C0C0", "Silver",
"FF99CC", "Pink",
"FFCC99", "Peach",
"FFFF99", "Light yellow",
"CCFFCC", "Pale green",
"CCFFFF", "Pale cyan",
"99CCFF", "Light sky blue",
"CC99FF", "Plum",
"FFFFFF", "White"
';
$custom_colours = '
"f1364e", "red Orange",
"3c515f", "Oxford",
"6b7c82", "Gray",
"1a2127", "Dark",
';
$init['textcolor_map'] = '['.$default_colours.','.$custom_colours.']';
$init['textcolor_rows'] = 6; // expand colour grid to 6 rows
return $init;
}
function gett($str) {
return $str;
}
function getCountry() {
if(function_exists('user_location')) {
$geo = get_user_location();
return $geo->names['en'];
}
return '';
}
add_filter('tiny_mce_before_init', 'my_mce4_options');
function clean_menu($nav) {
$menu = preg_replace( array( '#^<div[^>]*>#', '#</div>$#' ), '', $nav );
return preg_replace( array( '#^<ul[^>]*>#', '#</ul>$#' ), '', $menu );
}
function modify_jquery() {
if (!is_admin()) {
// comment out the next two lines to load the local copy of jQuery
wp_deregister_script('jquery');
wp_register_script('jquery', '', false, '1.12.4', true); //https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.js
wp_enqueue_script('jquery');
}
}
add_action('init', 'modify_jquery');
function getImageSrc($imageId) {
return wp_get_attachment_url($imageId);
}
function change_frontend_editor_iframe_url($url) {
return str_replace("http:", "", $url);
}
add_filter('vc_frontend_editor_iframe_url', 'change_frontend_editor_iframe_url');
function disable_srcset( $sources ) {
return false;
}
add_filter( 'wp_calculate_image_srcset', 'disable_srcset' );