bb_view_query

The BuddyPress bb view query function.

Description

bb_view_query( $view, (string) $new_args = '' ); 

Parameters (2)

0. $view
The view.
1. $new_args — Optional. (string) => ''
The new args.

Usage

  1. if ( !function_exists( 'bb_view_query' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-core.php'; 
  3.  
  4. // The view. 
  5. $view = null; 
  6.  
  7. // The new args. 
  8. $new_args = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_view_query($view, $new_args); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-core.php  
  1. function bb_view_query( $view, $new_args = '' ) { 
  2. global $bb_views; 
  3.  
  4. $view = bb_slug_sanitize( $view ); 
  5. if ( !isset($bb_views[$view]) ) 
  6. return false; 
  7.  
  8. if ( $new_args ) { 
  9. $new_args = wp_parse_args( $new_args ); 
  10. $query_args = array_merge( $bb_views[$view]['query'], $new_args ); 
  11. } else { 
  12. $query_args = $bb_views[$view]['query']; 
  13.  
  14. return new BB_Query( 'topic', $query_args, "bb_view_$view" );