softsdev_mc_product_cat_edit_meta_field

Render Edit page of product category.

Description

softsdev_mc_product_cat_edit_meta_field( (type) $term ); 

Parameters (1)

0. $term (type)
The term.

Usage

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

Defined (1)

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

/woocommerce-mailchimp-free.php  
  1. function softsdev_mc_product_cat_edit_meta_field($term) 
  2.  
  3. $softsdev_wc_mc_setting = get_softsdev_wc_mc_setting(); 
  4. if( !@$softsdev_wc_mc_setting['api'] ) return '';  
  5. $groups = softsdev_get_mc_groups(); 
  6. // put the term ID into a variable 
  7. $t_id = $term->term_id; 
  8. // retrieve the existing value(s) for this meta field. This returns an array 
  9. $softsdev_mc_terms_groups = get_option('softsdev_mc_term_group'); 
  10. ?> 
  11. <tr class="form-field"> 
  12. <th scope="row" valign="top"><label for="softsdev_mc_group"><?php _e('Mailchimp Group', 'softsdev'); ?></label></th> 
  13. <td> 
  14. <?php 
  15. echo woocommerce_wp_select( 
  16. array( 
  17. 'value' => @$softsdev_mc_terms_groups['term'.$softsdev_wc_mc_setting['list_mgroup_id'].'_' . $t_id],  
  18. 'id' => 'softsdev_mc_group',  
  19. 'options' => array('' => 'Select Group') + softsdev_mc_list_data($groups, 'name', 'name') 
  20. ); 
  21. ?> 
  22. <p class="description"><?php _e('Enter a value for this field', 'softsdev'); ?></p> 
  23. </td> 
  24. </tr> 
  25. <?php