bbp_add_view_all

Append 'view=all' to query string if it's already there from referer.

Description

(string) bbp_add_view_all( (string) $original_link = '', (bool) $force = false ); 

Returns (string)

The link with 'view=all' appended if necessary

Parameters (2)

0. $original_link — Optional. (string) => ''
Original Link to be modified
1. $force — Optional. (bool) => false
Override bbp_get_view_all() check

Usage

  1. if ( !function_exists( 'bbp_add_view_all' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/common/functions.php'; 
  3.  
  4. // Original Link to be modified 
  5. $original_link = ''; 
  6.  
  7. // Override bbp_get_view_all() check 
  8. $force = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bbp_add_view_all($original_link, $force); 
  12.  

Defined (1)

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

/includes/common/functions.php  
  1. function bbp_add_view_all( $original_link = '', $force = false ) { 
  2.  
  3. // Are we appending the view=all vars? 
  4. if ( bbp_get_view_all() || !empty( $force ) ) { 
  5. $link = add_query_arg( array( 'view' => 'all' ), $original_link ); 
  6. } else { 
  7. $link = $original_link; 
  8.  
  9. return apply_filters( 'bbp_add_view_all', $link, $original_link );