-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
107 lines (78 loc) · 1.82 KB
/
index.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
<?php
/*
Plugin Name: Woocommerce Limit Access
Plugin URI: https://github.com/K4H3NY4
Description: This plugin will Limit access to woocommerce product edit option to the user role selected
Author: John Kahenya
Version: 0.3
Author URI: https://github.com/K4H3NY4
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
//Hide duplicate buttons
add_filter( 'woocommerce_register_post_type_shop_order','your_function_name' );
function your_function_name($fields) {
$user = wp_get_current_user();
if ( in_array( 'administrator', (array) $user->roles ) ) {
echo(' <style>
span.duplicate {
display: none !important;
}
div#export-action {
display: none !important;
}
div#duplicate-action {
display: none !important;
}
div#general_product_data {
display: none !important;
}
li.general_options.general_tab {
display: none !important;
}
li.shipping_options.shipping_tab {
display: none !important;
}
li.product_labels {
display: none !important;
}
li.marketplace-suggestions_options.marketplace-suggestions_tab {
display: none !important;
}
li.linked_product_options.linked_product_tab {
display: none !important;
}
li.advanced_options.advanced_tab {
display: none !important;
}
input#title {
pointer-events: none !important;
}
#delete-action {
float: left;
line-height: 2.30769231;
display: none !important;
}
div#catalog-visibility {
display: none !important;
}
div#misc-publishing-actions {
display: none !important;
}
div#preview-action {
display: none !important;
}
li.preorder_options.preorder_tab {
display: none !important;
}
span.trash {
display: none !important;
}
span.inline.hide-if-no-js {
display: none;
}
</style> ');
} else {
return $fields;
}
}