-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
39 lines (33 loc) · 1016 Bytes
/
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
<?php
/* Write your awesome functions below */
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
function disable_search( $query, $error = true )
{
if ( is_search() ) {
$query->is_search = false;
$query->query_vars[s] = false;
$query->query[s] = false;
// to error
if ( $error == true )
$query->is_404 = true;
}
}
add_action('parse_query', 'disable_search');
add_filter( 'get_search_form', function() { return null;} );
function image_cdn_sitemap_fix($uri)
{
return str_replace( 'https://s.wpinter.com', 'https://cdn.statically.io/img/farrelf.wpinter.com', $uri );
}
add_filter('wpseo_xml_sitemap_img_src', 'image_cdn_sitemap_fix');
function emoji_svg_cdn_url()
{
return $default_url = "https://cdn.statically.io/libs/twemoji/12.0.4/2/svg/";
}
add_filter('emoji_svg_url', 'emoji_svg_cdn_url');
function emoji_png_cdn_url()
{
return $default_url = "https://cdn.statically.io/libs/twemoji/12.0.4/2/72x72/";
}
add_filter('emoji_url', 'emoji_png_cdn_url');