diff --git a/includes/admin/class-wc-admin.php b/includes/admin/class-wc-admin.php index 007c974f7b5..540fcca3871 100644 --- a/includes/admin/class-wc-admin.php +++ b/includes/admin/class-wc-admin.php @@ -159,7 +159,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' ); diff --git a/includes/wc-user-functions.php b/includes/wc-user-functions.php index 94594673d43..6522fb758c2 100644 --- a/includes/wc-user-functions.php +++ b/includes/wc-user-functions.php @@ -17,14 +17,12 @@ if ( ! defined( 'ABSPATH' ) ) { /** * Prevent any user who cannot 'edit_posts' (subscribers, customers etc) from seeing the admin bar. * - * Note: get_option( 'woocommerce_lock_down_admin', true ) is a deprecated option here for backwards compatibility. Defaults to true. - * * @access public * @param bool $show_admin_bar * @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; }