daily pastebin goal
48%
SHARE
TWEET

Hook to Add Your Keys to Product Array

sparkweb Sep 4th, 2011 251 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Add Your Own Keys to the $product array
  2. //This should go in your functions.php file
  3. add_filter('foxyshop_setup_product_info', 'my_product_setup', 10, 2);
  4. function my_product_setup($product_array, $product_id) {
  5.        
  6.         //Do as many of these as you want
  7.         $product_array['my_custom_field'] = get_post_meta($product_id, 'my_custom_field', 1);
  8.        
  9.         //Always return the new, complete array
  10.         return $product_array;
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top