Disable admin bar for customers. Closes #772.

This commit is contained in:
Mike Jolley 2012-03-12 09:43:22 +00:00
parent 6c64be6cbc
commit cdbcda7dab
3 changed files with 14 additions and 1 deletions

View File

@ -152,6 +152,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Menu tweaks + new icons
* My account ssl (added by justinstern)
* Prevented order save code running multiple times
* Disable admin bar for customers when admin access if locked down
= 1.5.1 - 08/03/2012 =
* Persistent (logged-in) customer carts (thanks dominic-p)

View File

@ -58,6 +58,16 @@ if (!function_exists('woocommerce_empty_cart')) {
}
}
/**
* WooCommerce disable admin bar
*
**/
if (!function_exists('woocommerce_disable_admin_bar')) {
function woocommerce_disable_admin_bar() {
add_filter('show_admin_bar', '__return_false');
}
}
/**
* Load the cart upon login
**/

View File

@ -110,9 +110,11 @@ add_filter( 'wp_nav_menu_items', 'woocommerce_nav_menu_items', 10, 2 );
/* Clear the cart */
if (get_option('woocommerce_clear_cart_on_logout')=='yes') add_action( 'wp_logout', 'woocommerce_empty_cart' );
add_action( 'wp', 'woocommerce_clear_cart_after_payment' );
/* Disable admin bar */
if (get_option('woocommerce_lock_down_admin')=='yes') add_action( 'init', 'woocommerce_disable_admin_bar' );
/* Catalog sorting/ordering */
add_action( 'init', 'woocommerce_update_catalog_ordering' );