Skip to content

Instantly share code, notes, and snippets.

@growdev
Created April 16, 2020 15:34
Show Gist options
  • Save growdev/61cf74da5efd3ac5940673307b40127e to your computer and use it in GitHub Desktop.
Save growdev/61cf74da5efd3ac5940673307b40127e to your computer and use it in GitHub Desktop.
Add product types to front end of site.
<?php
/**
* Add the booking product and accommodation product type to the list on frontend of site.
*/
function sp_add_post_types( $types ) {
$types['booking'] = __('Bookable product', 'woocommerce-bookings');
$types['accommodation-booking'] = __('Accommodation product', 'woocommerce-accommodation-bookings');
return $types;
}
if ( ! is_admin() ) {
add_filter( 'product_type_selector', 'sp_add_post_types' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment