Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


Limit results to current user only (orders page)

Hi all, I'm desperately trying to tweak woocommerce to to one unusual thing : allow customers (more like partners) to search and delete orders. The website is not about selling stuff, it's a tool for partners to generate quotes for their customers and those partners want some control. My idea was to give them a limited access to the WP backend as the admin orders page would be perfect for them. It's editable and searchable BUT it displays ALL the shop orders and I want to limit the results to only the currently logged user's orders. In the URL I saw that the called post type for this page is "shop_order" and I thought that tweaking with the "class-wc-post-types.php" file would be a good start but I'm no developper. Is there a parameter that I can add to the wc_register_order_type('shop_order' section ? If not any other suggestion ? Thanks in advance