Restriction on Order status
-
Hi,
I am restricting order status depending of the user roles.
For regular order page, I have used the following snippet :add_filter('wc_order_statuses', 'filter_order_statuses', 100 ); function filter_order_statuses( $statuses ) { global $pagenow, $typenow; if( in_array( $pagenow, array('post.php', 'post-new.php') ) && 'shop_order' === $typenow && user_roles_allowed_orders() ) { $allowed_statusses = array('wc-on-hold', 'wc-processing'); foreach ($statuses as $key => $option ) { if( ! in_array( $key, $allowed_statusses ) ){ unset($statuses[$key]); } } } return $statuses; }
Is it possible to apply something similar to the Phone Orders page?
Thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Restriction on Order status’ is closed to new replies.