Skip to content

Instantly share code, notes, and snippets.

@leewillis77
Created April 7, 2020 08:36
Show Gist options
  • Save leewillis77/4d49a70143d4178f44c632c450974dc8 to your computer and use it in GitHub Desktop.
Save leewillis77/4d49a70143d4178f44c632c450974dc8 to your computer and use it in GitHub Desktop.
Mark field as able to prepopulate
<?php
/*
* Plugin Name: Mark GPF fields as pre-populatable
* Plugin URI: http://docs.woothemes.com/document/google-product-feed/
* Description: Example of how to mark a field as pre-populatable in the Google Product Feed plugin.
* Version: 1.0
* Author: Ademti Software
* Author URI: https://www.ademti-software.co.uk/
*/
add_filter( 'woocommerce_gpf_all_product_fields', function ( $fields ) {
$fields['energy_efficiency_class']['can_prepopulate'] = true;
return $fields;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment