Skip to content

Instantly share code, notes, and snippets.

@braddalton
Created December 4, 2023 17:59
Show Gist options
  • Save braddalton/0e2827874da7c7b2e3a725d15c88cd0e to your computer and use it in GitHub Desktop.
Save braddalton/0e2827874da7c7b2e3a725d15c88cd0e to your computer and use it in GitHub Desktop.
Set Default Product Type to Variable in WooCommerce https://wpsites.net/?p=114472
function set_default_product_type_variable() {
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
// Set the default product type to "variable"
$('#product-type').val('variable').change();
});
</script>
<?php
}
add_action('admin_footer', 'set_default_product_type_variable');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment