esc_html__( "Displays the current forum's information, including the number of topics, replies, Last post by, and Last activity, as well as the Subscribe button", 'bbp-core' ), 'classname' => 'bbpc_forum_information' ) ); } // Front End public function widget( $args, $instance ) { // if single forum page if ( ! isset( $args['widget_id'] ) ) { $args['widget_id'] = $this->id; } $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : esc_html__( 'Forum Informations', 'bbp-core' ); $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $show_icons = $instance['show_icons'] ?? false; $show_topics_count = $instance['show_topics_count'] ?? false; $show_replies_count = $instance['show_replies_count'] ?? false; $show_last_post_user = $instance['show_last_post_user'] ?? false; $show_last_activity = $instance['show_last_activity'] ?? false; $show_subscribe = $instance['show_subscribe'] ?? false; echo wp_kses_post( $args['before_widget'] ); if( is_bbpress() && is_singular( 'forum' ) ) : $forum_id = bbp_get_forum_id(); $topic_count = bbp_get_forum_topic_count( $forum_id ); $reply_count = bbp_get_forum_reply_count( $forum_id ); $last_active = bbp_get_forum_last_active_time( $forum_id ); $last_active_user_id = bbp_get_forum_last_active_id( $forum_id ); $last_active_user = get_post_field( 'post_author', $last_active_user_id ); if ( $title ) { echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] ); } if ( $show_topics_count == 'on' || $show_replies_count == 'on' || $show_last_post_user == 'on' || $show_last_activity == 'on' || $show_subscribe == 'on') : ?>
<?php esc_attr_e( 'BBP Core Pro avatar icon', 'bbp-core' ); ?>
'. esc_html__('Login to subscribe', 'bbp-core') .'' ); } ?>