Skip to content

Instantly share code, notes, and snippets.

@jessepearson
Last active December 11, 2022 07:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jessepearson/3279983d904e30ca51537ca849c2a4ad to your computer and use it in GitHub Desktop.
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.
<?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