Forum Replies Created
-
AuthorPosts
-
bikostudioParticipant
I discovered that i have to re-edit the role from the new user role method comping with the new version 🙂 … all done now!
bikostudioParticipantHi, After I updated the plugin to the V.4.19 the admin bar disappeared again for the rols! 🙂
bikostudioParticipantThis one works great Vladimir! thank you so much 🙂
bikostudioParticipantThank you so much Vladimir but i’m not so good in coding can you please type the this code for me:
roles :
data_entry
operator
managerthanks for your time 🙂
bikostudioParticipantaha i see now! .. it’s working .. thank you so much. Now if I want to add more roles I need to copy it many times right?
bikostudioParticipantok waiting 🙂
bikostudioParticipantI did that the only plugin do this is woocommerce. I think they change the way they block the admin bar in the new virsion. I really don’t know!
bikostudioParticipantLook, when I past this code in the woocommerce/includes/wc-user-functions.php
right after this
unction wc_disable_admin_bar( $show_admin_bar ) {
if ( apply_filters( ‘woocommerce_disable_admin_bar’, get_option( ‘woocommerce_lock_down_admin’, ‘yes’ ) === ‘yes’ ) && ! ( current_user_can( ‘edit_posts’ ) || current_user_can( ‘manage_woocommerce’ ) ) ) {
$show_admin_bar = false;
}return $show_admin_bar;
}
add_filter( ‘show_admin_bar’, ‘wc_disable_admin_bar’, 10, 1 );it shows the admin bar even for the non user, for visitors
bikostudioParticipantI did past this code tot the file :
<?php
add_filter(‘woocommerce_disable_admin_bar’, ‘_wc_disable_admin_bar’, 10, 1);
function _wc_disable_admin_bar($prevent_admin_access) {
return ‘no’;
}add_filter(‘woocommerce_prevent_admin_access’, ‘_wc_prevent_admin_access’, 10, 1);
function _wc_prevent_admin_access($prevent_admin_access) {
return false;
}any wrong here?
bikostudioParticipantnothing my friend! .. I hate woocommerce!! 🙁
bikostudioParticipantok i will try this now
bikostudioParticipantI don’t see mu-plugins folder too
bikostudioParticipantand what should i name the file?
bikostudioParticipantI did what post said but no change .. I pasted this code to the function.php in child theme folder and the child theme is activated.
and data entry users can not access admin bar
code :<?php
add_filter(‘woocommerce_disable_admin_bar’, ‘_wc_disable_admin_bar’, 10, 1);
function _wc_disable_admin_bar($prevent_admin_access) {
if (!current_user_can(‘data_entry’)) {
return $prevent_admin_access;
}
return ‘no’;
}add_filter(‘woocommerce_prevent_admin_access’, ‘_wc_prevent_admin_access’, 10, 1);
function _wc_prevent_admin_access($prevent_admin_access) {
if (!current_user_can(‘data_entry’)) {
return $prevent_admin_access;
}
return false;
}/* Start writing your functions here
bikostudioParticipantThanks i will give it try and tell you 🙂
-
AuthorPosts