pmpro_bbp_error_msg

Add membership level required message if user does not have access.

Description

apply_filters( 'pmpro_bbp_error_msg', (string) $you_do_not_have_the_required_membership_level_to_access_that_forum ); 

Parameters (1)

0. $you_do_not_have_the_required_membership_level_to_access_that_forum (string) => 'You do not have the required membership level to access that forum.'
The you do not have the required membership level to access that forum.

Usage

To run the hook, copy the example below.
  1. $you_do_not_have_the_required_membership_level_to_access_that_forum = apply_filters( 'pmpro_bbp_error_msg', $you_do_not_have_the_required_membership_level_to_access_that_forum ); 
  2.  
  3. if ( !empty( $you_do_not_have_the_required_membership_level_to_access_that_forum ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the pmpro_bbp_error_msg callback 
  2. function filter_pmpro_bbp_error_msg( $you_do_not_have_the_required_membership_level_to_access_that_forum ) { 
  3. // make filter magic happen here... 
  4. return $you_do_not_have_the_required_membership_level_to_access_that_forum
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'pmpro_bbp_error_msg', 'filter_pmpro_bbp_error_msg', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'pmpro_bbp_error_msg', 'filter_pmpro_bbp_error_msg', 10, 1 ); 

Defined (1)

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

/pmpro-bbpress.php  
  1. $pmpro_bbp_error_msg = apply_filters('pmpro_bbp_error_msg', 'You do not have the required membership level to access that forum.'); // error message to display