softsdev_mc_product_add_new_meta_field

Add Extra colum to woocommerce product.

Description

softsdev_mc_product_add_new_meta_field( $post ); 

Parameters (1)

0. $post
The post.

Usage

  1. if ( !function_exists( 'softsdev_mc_product_add_new_meta_field' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-categories-mailchimp-groups/woocommerce-mailchimp-free.php'; 
  3.  
  4. // The post. 
  5. $post = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = softsdev_mc_product_add_new_meta_field($post); 
  9.  

Defined (1)

The function is defined in the following location(s).

/woocommerce-mailchimp-free.php  
  1. function softsdev_mc_product_add_new_meta_field($post) 
  2. $softsdev_mc_group = get_post_meta( $post->ID, 'softsdev_mc_group', true ); 
  3.  
  4. $softsdev_wc_mc_setting = get_softsdev_wc_mc_setting(); 
  5. if( !@$softsdev_wc_mc_setting['api'] ) return ''; 
  6. $groups = softsdev_get_mc_groups(); 
  7. // this will add the custom meta field to the add new term page 
  8. ?> 
  9. <tr class="form-field"> 
  10. <th scope="row" valign="top"><label for="softsdev_mc_group"><?php _e('Mailchimp Group', 'softsdev_mc'); ?></label></th> 
  11. <td> 
  12. <?php 
  13. echo woocommerce_wp_select( 
  14. array( 
  15. 'value' => $softsdev_mc_group,  
  16. 'label' => '',  
  17. 'id' => 'softsdev_mc_group',  
  18. 'options' => array('1' => 'Select Group') + softsdev_mc_list_data($groups, 'name', 'name') 
  19. ); 
  20. ?> 
  21. <p class="description"><?php _e('Enter a value for this field', 'softsdev'); ?></p> 
  22. </td> 
  23. </tr> 
  24. <?php 
  25. }