Created
April 16, 2020 15:34
-
-
Save growdev/61cf74da5efd3ac5940673307b40127e to your computer and use it in GitHub Desktop.
Add product types to front end of site.
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 | |
/** | |
* 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