示例#1
0
" <?php 
    comment_class($comment_class);
    ?>
>
    <div class="row">
        <div class="col-md-2">
            <div class="booking-item-review-person">
                <a class="booking-item-review-person-avatar round" href="#">
                    <?php 
    $comment_id = get_comment_ID();
    $user_id = get_comment($comment_id)->user_id;
    $user_email = get_comment($comment_id)->comment_author_email;
    $current_user = wp_get_current_user();
    $custom_avatar = st_get_profile_avatar($user_id, 70);
    if (!empty($custom_avatar)) {
        echo st_get_profile_avatar($user_id, 70);
    } else {
        echo st_get_profile_avatar_by_email($user_email, 70);
    }
    ?>
                </a>
                <p class="booking-item-review-person-name">
                    <?php 
    printf(__('%s', ST_TEXTDOMAIN), sprintf('<cite class="fn">%s</cite>', get_comment_author_link()));
    ?>
                </p>
                <p class="booking-item-review-person-loc"><?php 
    $user_show_address = apply_filters('st_user_show_address', false);
    if ($user_show_address) {
        echo get_user_meta($user_id, 'st_address', true);
    }
 public function widget($args, $instance)
 {
     global $comments, $comment;
     $cache = array();
     if (!$this->is_preview()) {
         $cache = wp_cache_get('widget_recent_comments', 'widget');
     }
     if (!is_array($cache)) {
         $cache = array();
     }
     if (!isset($args['widget_id'])) {
         $args['widget_id'] = $this->id;
     }
     if (isset($cache[$args['widget_id']])) {
         echo balanceTags($cache[$args['widget_id']]);
         return;
     }
     $output = '';
     $title = !empty($instance['title']) ? $instance['title'] : __('Recent Comments', ST_TEXTDOMAIN);
     /** This filter is documented in wp-includes/default-widgets.php */
     $title = apply_filters('widget_title', $title, $instance, $this->id_base);
     $number = !empty($instance['number']) ? absint($instance['number']) : 5;
     if (!$number) {
         $number = 5;
     }
     /**
      * Filter the arguments for the Recent Comments widget.
      *
      * @since 3.4.0
      *
      * @see get_comments()
      *
      * @param array $comment_args An array of arguments used to retrieve the recent comments.
      */
     $comments = get_comments(apply_filters('widget_comments_args', array('number' => $number, 'status' => 'approve', 'post_status' => 'publish')));
     $output .= $args['before_widget'];
     if ($title) {
         $output .= $args['before_title'] . $title . $args['after_title'];
     }
     $output .= '<ul class="thumb-list thumb-list-right">';
     if ($comments) {
         // Prime cache for associated posts. (Prime post term cache if we need it for permalinks.)
         $post_ids = array_unique(wp_list_pluck($comments, 'comment_post_ID'));
         _prime_post_caches($post_ids, strpos(get_option('permalink_structure'), '%category%'), false);
         foreach ((array) $comments as $comment) {
             $avatar = st_get_profile_avatar($comment->user_id, 50);
             $output .= '<li class="recentcomments">';
             $output .= '
                  ' . $avatar . '
                     ';
             $output .= '<div class="thumb-list-item-caption">
                 <p class="thumb-list-item-meta"><a href="' . esc_url(get_comment_link($comment->comment_ID)) . '">' . human_time_diff(get_comment_time('U'), current_time('timestamp')) . __(' ago', ST_TEXTDOMAIN) . '</a> </p>
                 <h4 class="thumb-list-item-title">
                 ' . sprintf(__('%s', ST_TEXTDOMAIN), sprintf('<cite class="fn">%s</cite>', get_comment_author_link())) . '
                 </h4>
         </div>';
             ob_start();
             comment_excerpt();
             $comment_excerpt = @ob_get_clean();
             $output .= '<p class="thumb-list-item-desciption">' . $comment_excerpt . '</p>';
             $output .= '</li>';
         }
     }
     $output .= '</ul>';
     $output .= $args['after_widget'];
     echo balanceTags($output);
     if (!$this->is_preview()) {
         $cache[$args['widget_id']] = $output;
         wp_cache_set('widget_recent_comments', $cache, 'widget');
     }
 }
示例#3
0
    comment_ID();
    ?>
" <?php 
    comment_class($comment_class);
    ?>
>
    <div id="div-comment-<?php 
    comment_ID();
    ?>
" class="article comment  clearfix" inline_comment="comment">
        <div class="comment-author">
            <?php 
    if (0 != $args['avatar_size']) {
        $comment_id = get_comment_ID();
        $user_id = get_comment($comment_id)->user_id;
        echo st_get_profile_avatar($user_id, $args['avatar_size']);
    }
    ?>
        </div><!-- .comment-avatar -->
        <div class="comment-inner">
            <span class="comment-author-name"><?php 
    printf(__('%s', ST_TEXTDOMAIN), sprintf('<cite class="fn">%s</cite>', get_comment_author_link()));
    ?>
</span>
            <?php 
    if ('0' == $comment->comment_approved) {
        ?>
                <p class="comment-awaiting-moderation"><?php 
        st_the_language('your_comment_need_approved');
        ?>
</p>
示例#4
0
        ?>
    
        <?php 
        $account_dashboard = st()->get_option('page_my_account_dashboard');
        $location = '#';
        if (!empty($account_dashboard)) {
            $location = esc_url(add_query_arg('page_id', $account_dashboard, home_url()));
        }
        ?>
        <a href="<?php 
        echo esc_url($location);
        ?>
">
            <?php 
        $current_user = wp_get_current_user();
        echo st_get_profile_avatar($current_user->ID, 40);
        //echo st_get_language('hi').', '.$current_user->display_name;
        printf(__('hi, %s', ST_TEXTDOMAIN), $current_user->display_name);
        ?>
        </a>
    <?php 
        echo balanceTags('</' . $container . '>');
        ?>
    <?php 
        echo balanceTags('<' . $container . '>');
        ?>
        <a class="btn-st-logout" href="<?php 
        echo wp_logout_url(home_url());
        ?>
"><?php 
        st_the_language('sign_out');