-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
94 lines (70 loc) · 2.94 KB
/
functions.php
File metadata and controls
94 lines (70 loc) · 2.94 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
83
84
85
86
87
88
89
90
91
92
93
94
<?php
add_action('init', function () {
remove_action('storefront_header', 'storefront_product_search', 40);
remove_action( 'storefront_header', 'storefront_site_branding', 20 );
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
remove_action( 'storefront_footer', 'storefront_handheld_footer_bar', 999 );
}, 10, 0);
add_filter('theme_mod_custom_logo', function () {
return true;
}, 10, 0);
add_action('storefront_header', function () {
$tag = is_home() ? 'h1' : 'div';
$html = '<' . esc_attr($tag) . ' class="site-logo-wrapper"><a href="' . esc_url( home_url( '/' ) ) . '" rel="home"><img src="' . get_stylesheet_directory_uri() . '/images/logo.svg" alt="' . esc_attr(get_bloginfo( 'name' )) . ' logo" class="site-logo"><span>' . get_bloginfo( 'name' ) . '</span></a></' . esc_attr($tag) . '>';
if ( '' !== get_bloginfo( 'description' ) ) {
$html .= '<p class="site-description">' . esc_html( get_bloginfo( 'description', 'display' ) ) . '</p>';
}
echo $html;
}, 20, 0);
add_filter('storefront_copyright_text', function () { return ''; }, 10, 0);
add_filter('storefront_credit_links_output', function () {
return '© AllRad ' . gmdate( 'Y' ) . ' | <a href="/datenschutz">Datenschutz</a> | <a href="/impressum">Impressum</a>';
}, 10, 0);
add_filter('body_class', function($classes) {
if (!is_page() || is_front_page())
return $classes;
global $post;
$classes[] = 'post-slug-' . $post->post_name;
return $classes;
});
/*
* removes woocommerce marketing feature
*/
add_filter( 'woocommerce_admin_features', function(array $features): array {
$marketing = array_search('marketing', $features);
unset( $features[$marketing] );
return $features;
});
add_filter( 'woocommerce_helper_suppress_admin_notices', '__return_true' );
add_filter( 'woocommerce_admin_disabled', '__return_true' );
/*
* removes woocommerce dashboard meta box
*/
add_action('wp_dashboard_setup', function () {
remove_meta_box('woocommerce_dashboard_status', 'dashboard', 'normal');
});
/*
* removes notices
*/
add_action('wp_loaded', function () {
remove_action('admin_notices', 'vendidero_helper_notice');
remove_action('admin_notices', 'woothemes_updater_notice');
});
add_filter('woocommerce_billing_fields', function ($fields = array() ) {
unset($fields['billing_company']);
unset($fields['billing_address_1']);
unset($fields['billing_address_2']);
unset($fields['billing_state']);
unset($fields['billing_city']);
unset($fields['billing_phone']);
unset($fields['billing_postcode']);
unset($fields['billing_country']);
return $fields;
});
add_filter( 'woocommerce_checkout_fields', function ( $fields ) {
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_state']);
return $fields;
}, 99);