Skip to content

Instantly share code, notes, and snippets.

@octaedro
Last active July 15, 2022 14:08
Show Gist options
  • Save octaedro/4230eac7e4395a52767392cc21778bef to your computer and use it in GitHub Desktop.
Save octaedro/4230eac7e4395a52767392cc21778bef to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Add custom product type
* Description: This plugin adds a product type to test PR #33755 (https://github.com/woocommerce/woocommerce/pull/33755).
* Version: 0.1
*
*/
function add_custom_product_type( $array ) {
if ( is_array( $array ) ) {
return array_merge( $array, array( 'my-product' => 'My product' ) );
}
return $array;
}
add_filter( 'product_type_selector', 'add_custom_product_type',10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment