Function Reference: geodir_buddypress_reviews_html
Summary
BuddyPress reviews Tab content.
Package
GeoDirectory_BuddyPress_Integration
Parameters
- $args
- (array) (required) Query arguments.
- Default: None
Change Log
Since: 1.0.0
Actions
‘geodir_wrapper_content_open’ [Line: 270]
‘geodir_main_content_open’ [Line: 273]
‘geodir_main_content_close’ [Line: 302]
‘geodir_wrapper_content_close’ [Line: 306]
Filters
‘gdbp_review_limit’ [Line: 229]
‘gdbp_review_list_sort’ [Line: 230]
‘gdbp_review_character_count’ [Line: 231]
‘comments_array’ [Line: 264]
‘comments_template’ [Line: 293]
Source File
geodir_buddypress_reviews_html() is located in geodir_buddypress/includes/gdbuddypress_template_functions.php [Line: 207]
Source Code
function geodir_buddypress_reviews_html( $args = array() ) { wp_register_style( 'gdbuddypress-style.css', GEODIR_BUDDYPRESS_PLUGIN_URL . '/css/gdbuddypress-style.css', array(), GEODIR_BUDDYPRESS_VERSION ); wp_enqueue_style( 'gdbuddypress-style.css'); $post_type = $args['post_type']; add_filter( 'comments_template', 'geodir_buddypress_comment_template', 100, 1 ); add_filter( 'comment_class', 'geodir_buddypress_comment_class', 100, 5 ); /* Show Comment Rating */ if ( defined( 'GEODIR_REVIEWRATING_PLUGINDIR_URL' ) && get_option( 'geodir_reviewrating_enable_rating' ) || get_option( 'geodir_reviewrating_enable_images' ) || get_option( 'geodir_reviewrating_enable_review' ) || get_option( 'geodir_reviewrating_enable_sorting' ) || get_option( 'geodir_reviewrating_enable_sharing' ) ) { global $geodir_post_type; $geodir_post_type = $post_type; add_filter( 'comment_text', 'geodir_reviewrating_wrap_comment_text', 12, 2 ); wp_register_script( 'geodir-reviewrating-review-script', GEODIR_REVIEWRATING_PLUGINDIR_URL.'/js/comments-script.js' ); wp_enqueue_script( 'geodir-reviewrating-review-script' ); wp_register_style( 'geodir-reviewratingrating-style', GEODIR_REVIEWRATING_PLUGINDIR_URL .'/css/style.css' ); wp_enqueue_style( 'geodir-reviewratingrating-style' ); } $review_limit = apply_filters( 'gdbp_review_limit', 5 ); $list_sort = apply_filters( 'gdbp_review_list_sort', 'latest' ); $character_count = apply_filters( 'gdbp_review_character_count', 200 ); $post_type_name = !empty( $args['post_type_name'] ) ? strtolower( $args['post_type_name'] ) : __( 'listings', GDBUDDYPRESS_TEXTDOMAIN ); $query_args = array( 'posts_per_page' => $review_limit, 'is_geodir_loop' => true, 'gd_location' => false, 'post_type' => $post_type, 'order_by' => $list_sort ); $author_id = bp_displayed_user_id() ? bp_displayed_user_id() : bp_loggedin_user_id(); $logged_id = bp_loggedin_user_id(); $defaults = array(); $args = array( 'post_type' => $post_type, 'order' => 'DESC', 'orderby' => 'comment_date_gmt', 'status' => 'approve', 'user_id' => $author_id, 'number' => 20 ); if ( $logged_id && $logged_id == $author_id ) { $args['include_unapproved'] = array( $author_id ); } $args = wp_parse_args( $args, $defaults ); global $wp_query; $query = new WP_Comment_Query; $comments = $query->query( $args ); $wp_query->comments = apply_filters( 'comments_array', $comments, '' ); $comments = $wp_query->comments; $wp_query->comment_count = count($wp_query->comments); ###### MAIN CONTENT WRAPPERS OPEN ###### // this adds the opening html tags to the content div, this required the closing tag below :: ($type='',$id='',$class='') do_action( 'geodir_wrapper_content_open', 'gdbp-reviews-page', 'geodir-wrapper-content', 'gdbp-wrapper-content gdbp-wrapper-reviews' ); // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') do_action( 'geodir_main_content_open', 'gdbp-reviews-page', 'reviewsTab', 'gdbp-main-content gdbp-reviews-content'); $overridden_cpage = false; if ( '' == get_query_var('cpage') && get_option('page_comments') ) { set_query_var( 'cpage', 'newest' == get_option('default_comments_page') ? get_comment_pages_count() : 1 ); $overridden_cpage = true; } if ( !defined('COMMENTS_TEMPLATE') ) define('COMMENTS_TEMPLATE', true); $file = '/comments.php'; $theme_template = STYLESHEETPATH . $file; /** * Filter the path to the theme template file used for the comments template. * * @since 1.5.1 * * @param string $theme_template The path to the theme template file. */ $include = apply_filters( 'comments_template', $theme_template ); if ( file_exists( $include ) ) require( $include ); elseif ( file_exists( TEMPLATEPATH . $file ) ) require( TEMPLATEPATH . $file ); else // Backward compat code will be removed in a future release require( ABSPATH . WPINC . '/theme-compat/comments.php'); do_action( 'geodir_main_content_close', 'gdbp-reviews-page' ); ###### MAIN CONTENT WRAPPERS CLOSE ###### // this adds the closing html tags to the wrapper_content div :: ($type='') do_action( 'geodir_wrapper_content_close', 'gdbp-reviews-page' ); }