This repository has been archived by the owner on Sep 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.php
executable file
·65 lines (49 loc) · 1.81 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
<?php
/*add_action('wp_footer', function(){
echo "<h1>∆TIME: " . (microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"]) . "</h1>";
});*/
/*add_action( 'wp_footer', function(){
if(current_user_can('manage_options')){
global $wp_filter;
var_dump( $wp_filter['wp_loaded'] );
}
} );*/
require_once locate_template('/functions/setup.php');
require_once locate_template('/functions/react.php');
require_once locate_template('/functions/admin-menu.php');
require_once locate_template('/functions/search.php');
require_once locate_template('/functions/woocommerce-invoice-gateway.php');
require_once locate_template('/functions/woocommerce.php');
require_once locate_template('/functions/woocommerce-discount.php');
require_once locate_template('/functions/enqueues.php');
require_once locate_template('/functions/shortcodes.php');
require_once locate_template('/functions/email.php');
require_once locate_template('/functions/rest.php');
require_once locate_template('/functions/sitemap.php');
class Hfag {
public function __construct(){
add_action('after_switch_theme', array($this, 'activation'), 0);
add_action('switch_theme', array($this, 'deactivation'), 0);
//Change wpmu behaviour
add_filter('wpmu_welcome_user_notification', '__return_false');
//make the switch to the new url easier and hopefully seamless
add_filter('post_type_link', function($permalink, $post){
return str_replace("api.feuerschutz", "shop.feuerschutz", $permalink);
}, 10, 2);
//Change mail sender
add_filter('wp_mail_from', function($from){
return "[email protected]";
}, 100);
add_filter('wp_mail_from_name', function($from_name){
return 'Hauser Feuerschutz AG';
}, 100);
}
public function activation(){
flush_rewrite_rules();
}
public function deactivation(){
flush_rewrite_rules();
}
}
new Hfag();
?>