Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leewillis77/f0daec3aa5bc24433236801447da6d78 to your computer and use it in GitHub Desktop.
Save leewillis77/f0daec3aa5bc24433236801447da6d78 to your computer and use it in GitHub Desktop.
Mark fields as pre-populatable in the WooCommerce Product Feeds extension
<?php
/**
* Plugin Name: WooCommerce Product Feeds : Mark fields as pre-populatable.
* Plugin URI: https://www.ademti-software.co.uk/
* Description: Marks fields in the Google Product Feed as pre-populatable.
* Author: Ademti Software
* Version: 1.0.0
* Author URI: https://www.ademti-software.co.uk
*/
add_filter( 'woocommerce_gpf_all_product_fields', function ( $fields ) {
$fields['age_group']['can_prepopulate'] = true;
$fields['gender']['can_prepopulate'] = true;
return $fields;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment