Members + WooCommerce
-
I created Customer Support -role for WooCommerce with Members plugin.
Role has capabilities to edit orders etc. Everything else works fine. The Role has access only on WooCommerce -related tools in the WordPress Dashboard.
But…
I noticed that Role requires “Edit Posts” -capability to create new Orders from the WP Dashboard.I narrowed it down and it seems the problem lies in WordPress core-files:
wp-admin/includes/plugin.php
Near line ~2132foreach ( array_keys( $_wp_submenu_nopriv ) as $key ) { if ( isset( $_wp_submenu_nopriv[ $key ][ $pagenow ] ) ) { die('--THE PROBLEM LIES HERE-- key:['.$key.']['.$pagenow.']<pre>'.print_r($_wp_submenu_nopriv,true).'</pre>'); return false; } if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[ $key ][ $plugin_page ] ) ) { return false; } }
This outputs:
–THE PROBLEM IS HERE– key:[edit.php][post-new.php]which implies because role has no capabilities to add new posts, it overrides ability to create shop_orders.
If I comment that line out, orders can be created with my new role and the members plugin still restricts access to everything I’ve wanted.
Still, is there a possibility to programmatically “remove” these core-restrictions, because I can’t modify wordpress core files because that would create monthly extra work.
- The topic ‘Members + WooCommerce’ is closed to new replies.