bbp_view_query

Run the view's query.

Description

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

Parameters (2)

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

Options

    ;        


    Usage

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

    Defined (1)

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

    /includes/core/functions.php  
    1. function bbp_view_query( $view = '', $new_args = '' ) { 
    2.  
    3. $view = bbp_get_view_id( $view ); 
    4. if ( empty( $view ) ) 
    5. return false; 
    6.  
    7. $query_args = bbp_get_view_query_args( $view ); 
    8.  
    9. if ( !empty( $new_args ) ) { 
    10. $new_args = bbp_parse_args( $new_args, '', 'view_query' ); 
    11. $query_args = array_merge( $query_args, $new_args ); 
    12.  
    13. return bbp_has_topics( $query_args );