pmpro_taxonomy_meta

The Paid Memberships Pro pmpro taxonomy meta function.

Description

pmpro_taxonomy_meta( $term ); 

Parameters (1)

0. $term
The term.

Usage

  1. if ( !function_exists( 'pmpro_taxonomy_meta' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/metaboxes.php'; 
  3.  
  4. // The term. 
  5. $term = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pmpro_taxonomy_meta($term); 
  9.  

Defined (1)

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

/includes/metaboxes.php  
  1. function pmpro_taxonomy_meta($term) 
  2. global $membership_levels, $post, $wpdb; 
  3.  
  4. $protectedlevels = array(); 
  5. foreach($membership_levels as $level) 
  6. $protectedlevel = $wpdb->get_col("SELECT category_id FROM $wpdb->pmpro_memberships_categories WHERE membership_id = $level->id AND category_id = $term->term_id"); 
  7. if(!empty($protectedlevel)) 
  8. $protectedlevels[] .= '<a target="_blank" href="admin.php?page=pmpro-membershiplevels&edit=' . $level->id . '">' . $level->name. '</a>'; 
  9. if(!empty($protectedlevels))  
  10. {  
  11. ?> 
  12. <tr class="form-field"> 
  13. <th scope="row" valign="top"><?php _e( 'Membership Levels', 'paid-memberships-pro' ); ?></label></th> 
  14. <td> 
  15. <p><strong> 
  16. <?php echo implode(', ', $protectedlevels); ?></strong></p> 
  17. <p class="description"><?php _e('Only members of these levels will be able to view posts in this category.', 'paid-memberships-pro' ); ?></p> 
  18. </td> 
  19. </tr> 
  20. <?php