Merge 17796
This commit is contained in:
commit
6a89a76c11
|
@ -168,7 +168,7 @@ class WC_Admin {
|
|||
public function prevent_admin_access() {
|
||||
$prevent_access = false;
|
||||
|
||||
if ( 'yes' === get_option( 'woocommerce_lock_down_admin', 'yes' ) && ! is_ajax() && basename( $_SERVER['SCRIPT_FILENAME'] ) !== 'admin-post.php' ) {
|
||||
if ( apply_filters( 'woocommerce_disable_admin_bar', true ) && ! is_ajax() && basename( $_SERVER["SCRIPT_FILENAME"] ) !== 'admin-post.php' ) {
|
||||
$has_cap = false;
|
||||
$access_caps = array( 'edit_posts', 'manage_woocommerce', 'view_admin_dashboard' );
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ defined( 'ABSPATH' ) || exit;
|
|||
* @return bool
|
||||
*/
|
||||
function 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' ) ) ) {
|
||||
if ( apply_filters( 'woocommerce_disable_admin_bar', true ) && ! ( current_user_can( 'edit_posts' ) || current_user_can( 'manage_woocommerce' ) ) ) {
|
||||
$show_admin_bar = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue