pmprobb_pmpro_membership_level_after_other_settings

The Paid Memberships Pro - bbPress Add On pmprobb pmpro membership level after other settings function.

Description

pmprobb_pmpro_membership_level_after_other_settings(); 

Usage

  1. if ( !function_exists( 'pmprobb_pmpro_membership_level_after_other_settings' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro-bbpress-add-on/includes/options-membership-levels.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = pmprobb_pmpro_membership_level_after_other_settings(); 
  7.  

Defined (1)

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

/includes/options-membership-levels.php  
  1. function pmprobb_pmpro_membership_level_after_other_settings() 
  2. $level_id = intval($_REQUEST['edit']);  
  3. $options = pmprobb_getOptions(); 
  4.  
  5. if(!empty($_REQUEST['forum_role'])) 
  6. $forum_role = sanitize_text_field($_REQUEST['forum_role']); 
  7. elseif(!empty($options['levels']) && !empty($options['levels'][$level_id]['role'])) 
  8. $forum_role = $options['levels'][$level_id]['role']; 
  9. else 
  10. $forum_role = ''; 
  11.  
  12. if(!empty($_REQUEST['forum_color'])) 
  13. $forum_color = preg_replace('/^0-9a-fA-F#/', '', $_REQUEST['forum_color']); 
  14. elseif(!empty($options['levels']) && !empty($options['levels'][$level_id]['color'])) 
  15. $forum_color = $options['levels'][$level_id]['color']; 
  16. else 
  17. $forum_color = ''; 
  18.  
  19. ?> 
  20. <h3 class="topborder">bbPress Settings</h3> 
  21. <table> 
  22. <tbody class="form-table"> 
  23. <tr> 
  24. <th scope="row" valign="top"><label for="forum_role"><?php _e('Forum Role', 'pmpro');?></label></th> 
  25. <td>  
  26. <select id="forum_role" name="forum_role"> 
  27. <option value="" <?php selected($forum_role, '');?>>Default Behavior</option> 
  28. <?php 
  29. $roles = bbp_get_dynamic_roles(); 
  30. if(!empty($roles)) { 
  31. foreach($roles as $value => $role) { 
  32. ?> 
  33. <option value="<?php echo esc_attr($value);?>" <?php selected($forum_role, $value);?>><?php echo $role['name'];?></option> 
  34. <?php 
  35. ?> 
  36. </select> 
  37. <small>Leave as "Default Behavior" if you don't need to change roles by membership level.</small> 
  38. </td> 
  39. </tr> 
  40. <tr> 
  41. <th scope="row" valign="top"><label for="forum_color"><?php _e('Background Color', 'pmpro');?></label></th> 
  42. <td>  
  43. <input type="text" id="forum_color" name="forum_color" value="<?php echo esc_attr($forum_color);?>" /> 
  44. <small>You can also add custom styles for .pmpro-level-<?php echo $level_id;?> via your CSS files.</small>  
  45. </td> 
  46. </tr>  
  47. </tbody> 
  48. </table> 
  49. <script><!-- 
  50. jQuery(document).ready(function() { 
  51. jQuery('#forum_color').wpColorPicker(); 
  52. }); 
  53. --></script> 
  54. <?php