Last active
December 11, 2022 07:20
-
-
Save jessepearson/3279983d904e30ca51537ca849c2a4ad to your computer and use it in GitHub Desktop.
WordPress will automatically create a Mine view for post types that have multiple authors. With a recent change to WooCommerce core, the customers are now the author of the orders, so Mine is showing and causing confusion. This filter will remove Mine from orders.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // do not copy this line | |
/** | |
* WordPress will automatically create a Mine view for post types that have multiple authors. | |
* With a recent change to WooCommerce core, the customers are now the author of the orders, so Mine is | |
* showing and causing confusion. This filter will remove Mine from orders. | |
* | |
* @param arr $views The current views being used for orders. | |
* @return arr The edited views array. | |
*/ | |
function jp_filter_edit_shop_order_views( $views ) { | |
// Unset the Mine option. | |
unset( $views['mine'] ); | |
return $views; | |
}; | |
add_filter( 'views_edit-shop_order', 'jp_filter_edit_shop_order_views' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment