MS_Helper_Member

Helper functions and data used by the Member class.

Defined (1)

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

/app/helper/class-ms-helper-member.php  
  1. class MS_Helper_Member extends MS_Helper { 
  2.  
  3. const MSG_MEMBER_ADDED = 1; 
  4. const MSG_MEMBER_DELETED = 2; 
  5. const MSG_MEMBER_UPDATED = 3; 
  6. const MSG_MEMBER_ACTIVATION_TOGGLED = 4; 
  7. const MSG_MEMBER_BULK_UPDATED = 5; 
  8. const MSG_MEMBER_USER_ADDED = 6; 
  9. const MSG_MEMBER_NOT_ADDED = -1; 
  10. const MSG_MEMBER_NOT_DELETED = -2; 
  11. const MSG_MEMBER_NOT_UPDATED = -3; 
  12. const MSG_MEMBER_ACTIVATION_NOT_TOGGLED = -4; 
  13. const MSG_MEMBER_BULK_NOT_UPDATED = -5; 
  14.  
  15. public static function get_admin_message( $msg = 0 ) { 
  16. $messages = apply_filters( 
  17. 'ms_helper_member_get_admin_messages',  
  18. array( 
  19. self::MSG_MEMBER_ADDED => __( 'Membership added.', MS_TEXT_DOMAIN ),  
  20. self::MSG_MEMBER_DELETED => __( 'Membership deleted.', MS_TEXT_DOMAIN ),  
  21. self::MSG_MEMBER_UPDATED => __( 'Member updated.', MS_TEXT_DOMAIN ),  
  22. self::MSG_MEMBER_ACTIVATION_TOGGLED => __( 'Member activation toggled.', MS_TEXT_DOMAIN ),  
  23. self::MSG_MEMBER_BULK_UPDATED => __( 'Members bulk updated.', MS_TEXT_DOMAIN ),  
  24. self::MSG_MEMBER_USER_ADDED => __( 'Users added to Membership2 member list.', MS_TEXT_DOMAIN ),  
  25. self::MSG_MEMBER_NOT_ADDED => __( 'Membership not added.', MS_TEXT_DOMAIN ),  
  26. self::MSG_MEMBER_NOT_DELETED => __( 'Membership not deleted.', MS_TEXT_DOMAIN ),  
  27. self::MSG_MEMBER_NOT_UPDATED => __( 'Member not updated.', MS_TEXT_DOMAIN ),  
  28. self::MSG_MEMBER_ACTIVATION_NOT_TOGGLED => __( 'Member activation not toggled.', MS_TEXT_DOMAIN ),  
  29. self::MSG_MEMBER_BULK_NOT_UPDATED => __( 'Members bulk not updated.', MS_TEXT_DOMAIN ),  
  30. ); 
  31.  
  32. if ( array_key_exists( $msg, $messages ) ) { 
  33. return $messages[ $msg ]; 
  34.  
  35. return null; 
  36.  
  37. public static function print_admin_message() { 
  38. $msg = ! empty( $_GET['msg'] ) ? (int) $_GET['msg'] : 0; 
  39.  
  40. $class = ( $msg > 0 ) ? 'updated' : 'error'; 
  41.  
  42. if ( $msg = self::get_admin_message( $msg ) ) { 
  43. lib2()->ui->admin_message( $msg, $class ); 
  44.