$user = wp_get_current_user();
if (!current_user_can('activate_plugins')) {
add_action('admin_head', 'removeCategories', 100);
function removeCategories()
{
echo "<style>#product_cat-23{display: none !important;}</style>";
}
}
It’s admin_head for admin UI.
Related Posts:
- WooCommerce which roles and capabilities control user login re-direct to Woo Account Page?
- How to add a menu page for options in wordpress for user that has the role of vendor?
- How to update user role without logout
- In WooCommerce filter the available Payment Methods by User Role [closed]
- Admin access for custom user capabilities
- WP_Query with meta_query for children
- WooCommerce limited role
- WooCommerce Customer Role Delete Custom Post Type
- Tried to create a user role that can only edit user information, but my test account cannot view the dashboard. What am I missing?
- Allow add new post access to custom post but not wp post for some role
- WooCommerce Admin order – Only run action if user is loaded
- WooCommerce get_author_posts_url() – Author URL redirecting to shop base
- I have 3 types of prices in WP and I need to change price for each specific user role using hooks
- Switch to user link shortcode
- How to show specific admin menu to specific user role?
- Assign user role by text field in WordPress (Woocommerce) [closed]
- Need help with woocommerce roles
- How to change user role after login?
- Woocommerce customer role doesn’t change if user is already a subscriber [closed]
- How to add capabilities for editor type user to access admin section
- WooThemes – Vendors / Bookings – Allow Vendors to manage resources
- Changing second user role while updating/downgrading membership level – s2member [closed]
- How to disable the “Upgrade or Downgrade” button in “My account” of WooCommerce Subscriptions
- Restrict the shop_manager role to the WooCommerce Orders Page
- Add another user role based on a defined input field in WordPress (Woocommerce)
- Removing unwanted role after purchase
- Groups of capabilities: users with multiple roles?
- how to use wc_create_order with subscription product
- Add custom variable to cart content [closed]
- Woocommerce My Account Endpoint – how to get ID parameter from URL?
- Default woocommerce placeholder image
- How to add Woocomrce cart page shipping calculator to my country state list
- Custom Woocommerce image size [closed]
- Let new user role to ‘edit_others_posts’ of other user role, not of its own type
- allow edit of custom post type but not regular posts?
- Users with custom roles can’t read each other’s comments
- Disabling the free shipping method when the cart has product/s which assigned a certain shipping class [closed]
- woocommerce_email_subject_customer_completed_order
- is_shop, is_home, is_front_page doesn’t work for woocommerce
- map_meta_cap woes
- Roles for Custom Post Types
- How to add a greeting message upon logging into WordPress for certain user role
- Modify some CSS with functions if (function_exists
- Limit total quantity of products in WooCommerce group product
- Variation name in $product->get_name()
- WordPress keeps moving my widgets to other widget areas
- How do I add an extra field to comment form above the submit button?
- woocommerce email template detect email recipient
- Add a role and give admin priviledges
- How to set the meta description of a WooCommerce product as its primary category description?
- How to change woocommerce checkout privacy policy, terms and condition text [closed]
- Woocommerce Email show HTML source code [closed]
- add to cart button not adding products in cart only in safari and edge browser [closed]
- WC Lightbox, Zoom and Slider not loading [closed]
- Woocomerce pulling wrong time from server -5 hrs difference
- How to use Custom Field to display product brief description in shop page with Woocommerce?
- What happens in the database when you link variations in woocommerce? [closed]
- Display custom product option in admin order details
- remove sale price after finished countdown in woocommerce
- Woocommerce. How can I charge a fee from seller
- See which user role / capability is needed to use a plugin
- How to update permalink programmatically?
- How to use decimal in quantity fields in WooCommerce for certain categories?
- Display shipping class in single product page woocommerce
- Is it ok to 301 redirect product-category pages to custom pages?
- how i can limit woo Category number like as ‘posts_per_page’ => -1, but it cannot work please help me
- Update a list of product to featured if product have meta value (Mysql not wpquery)
- Woocommerce – Add custom email footer to specific email template
- WooCommerce related product – only show from primary category
- Woocommerce: Variable Product – get variation name
- Forgot password flow does not work, getting email with a link but after clicking link it’s not working
- Html code is not showing in woocommerce shop page on adding in header.php?
- Is this code collecting user password?
- WordPress Migration
- some products free and some product is not free for shipping
- Importing Attributes in to Woocommerce
- woocomerce products and categories don’t display fixed
- Save Woocomerce discount as percentage to database
- Woocommerce Shipping based on condition and cart value
- Update order status based on condition
- How to bypass Woocommerce checkout validation from the plugin? [closed]
- Category with description and thumbnail
- Is there a way of retrieving the core WP capabilities?
- Woocommerce – Remove ‘Buy Product’ Button + Make Product Thumbnails Clickable
- Issue with Woocommerce and extra field in orders data
- Give auto discount to upsells products
- WooCommerce Table Rates not splitting up
- How can I let the user choose size of a shoe in the store? [closed]
- Hide/show specific products for backend users in woocommerce
- I’d like to add a button under the “Add to Cart” button which says “Buy on Amazon” and links to my Amazon product page [closed]
- If YITH Wishlist page is set to the WooCommerce my-account endpoint, the endpoints stop working all together. Any solution?
- Woocommerce checkout column total too small can not get it wider [closed]
- Custom e-commerce display for specific users [closed]
- how to show itemized shipping cost|? [closed]
- GET woocommerce order request is not showing meta data [closed]
- Add a custom meta column to a built-in import CSV file
- Hide/show button for the password field in the Woocommerce My Account page
- Converting longtext to mediumtext in WordPress wp_postmeta table
- How to remove product number count in the category within the sidebar woo commence
- Woocommerce send metadata to stripe