Filter "product_type_selector" should be applied everywhere, not only in admin area #407
Labels
priority: low
The issue/PR is low priority—not many people are affected or there’s a workaround, etc.
type: enhancement
The issue is a request for an enhancement.
type: technical debt
This issue/PR represents/solves the technical debt of the project.
What I expected
I use recommanded way to get products on a custom template:
WC_Product_Query
/wc_get_products()
, following the good practice from here.I'm expecting to get all my products with default params:
but
$products
is empty.I tracked it down to the filter
'product_type_selector'
(adding type'accommodation-booking'
, see methodWC_Accommodation_Booking_Admin_Panels::product_type_selector()
) not being applied when not on admin area.So
wc_get_product_types()
does not include'accommodation-booking'
and I'm forced to specify the type in query to get my products:Suggestion
Maybe I don't get the complete picture but I guess this
'product_type_selector'
filter should be called on plugin loading.PS: same thing for booking plugin
The text was updated successfully, but these errors were encountered: