protected function comment($comment, $depth, $args) { // each comment markup, without </li>! $classes = implode(' ', get_comment_class()) . ($comment->comment_author_email == get_the_author_meta('email') ? ' author-comment' : ''); // get typical wp comment classes and if comment belong post autor add "author-comment" class echo '<li id="li-comment-' . get_comment_ID() . '" class="' . $classes . '">' . "\n"; // parent tag with classes and uniq id echo '<div id="comment-' . get_comment_ID() . '">' . "\n"; // anchor element with this id need to anchor links on comments works echo get_avatar($comment, 64) . "\n"; // show avatar with size 64x64 px echo '<p class="meta">Posted by: ' . get_comment_author() . "\n"; // comment autor name echo ' ' . get_comment_author_email(); // comment autor email echo ' ' . get_comment_author_url(); // comment autor url echo ' On ' . get_comment_date('F j, Y') . ' at ' . get_comment_time() . '</p>' . "\n"; // date and time of comment creating if ('0' == $comment->comment_approved) { echo '<em class="comment-awaiting-moderation">Your comment is awaiting moderation</em>' . "\n"; } // if comment is not approved notify of it comment_text() . "\n"; // display comment text $reply_link_args = array('depth' => $depth, 'reply_text' => 'Reply on it', 'login_text' => 'You must be logged to post comments'); echo get_comment_reply_link(array_merge($args, $reply_link_args)); // display reply link echo '</div>' . "\n"; // anchor element end }
function xfac_get_avatar($avatar = '', $id_or_email, $size = 96, $default = '', $alt = '') { if (is_numeric($id_or_email)) { $wpUserId = (int) $id_or_email; } elseif (is_string($id_or_email) && ($user = get_user_by('email', $id_or_email))) { $wpUserId = $user->ID; } elseif (is_object($id_or_email) && !empty($id_or_email->user_id)) { $wpUserId = (int) $id_or_email->user_id; } if (empty($wpUserId)) { // cannot figure out the user id... return $avatar; } $apiRecords = xfac_user_getRecordsByUserId($wpUserId); if (empty($apiRecords)) { // no api records return $avatar; } $apiRecord = reset($apiRecords); if (empty($apiRecord->profile['links']['avatar'])) { // no avatar? return $avatar; } $avatar = $apiRecord->profile['links']['avatar']; $size = (int) $size; if (empty($alt)) { $alt = get_the_author_meta('display_name', $wpUserId); } $author_class = is_author($wpUserId) ? ' current-author' : ''; $avatar = "<img alt='" . esc_attr($alt) . "' src='" . esc_url($avatar) . "' class='avatar avatar-{$size}{$author_class} photo' height='{$size}' width='{$size}' />"; return $avatar; }
protected function comment($comment, $depth, $args) { // разметка каждого комментария, без закрывающего </li>! $classes = implode(' ', get_comment_class()) . ($comment->comment_author_email == get_the_author_meta('email') ? ' author-comment' : ''); // берем стандартные классы комментария и если коммент пренадлежит автору поста добавляем класс author-comment echo '<li id="li-comment-' . get_comment_ID() . '" class="' . $classes . '">' . "\n"; // родительский тэг комментария с классами выше и уникальным id echo '<div id="comment-' . get_comment_ID() . '">' . "\n"; // элемент с таким id нужен для якорных ссылок на коммент echo get_avatar($comment, 64) . "\n"; // покажем аватар с размером 64х64 echo '<p class="meta">Автор: ' . get_comment_author() . "\n"; // имя автора коммента //echo ' '.get_comment_author_email(); // email автора коммента echo ' ' . get_comment_author_url(); // url автора коммента echo ' <br>Добавлено ' . get_comment_date('F j, Y') . ' в ' . get_comment_time() . "\n"; // дата и время комментирования if ('0' == $comment->comment_approved) { echo '<em class="comment-awaiting-moderation">Ваш комментарий будет опубликован после проверки модератором.</em>' . "\n"; } // если комментарий должен пройти проверку comment_text() . "\n"; // текст коммента $reply_link_args = array('depth' => $depth, 'reply_text' => 'Ответить', 'login_text' => 'Вы должны быть залогинены'); echo get_comment_reply_link(array_merge($args, $reply_link_args)); // выводим ссылку ответить echo '</div>' . "\n"; // закрываем див }
/** * Prints HTML with meta information for the current post-date/time and author. */ function square_posted_on() { $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; if (get_the_time('U') !== get_the_modified_time('U')) { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; } $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date())); $posted_on = sprintf(esc_html_x('%s', 'post date', 'square'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>'); $byline = sprintf(esc_html_x('by %s', 'post author', 'square'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>'); $comment_count = get_comments_number(); // get_comments_number returns only a numeric value if (comments_open()) { if ($comment_count == 0) { $comments = __('No Comments', 'square'); } elseif ($comment_count > 1) { $comments = $comment_count . __(' Comments', 'square'); } else { $comments = __('1 Comment', 'square'); } $comment_link = '<a href="' . get_comments_link() . '">' . $comments . '</a>'; } else { $comment_link = __(' Comment Closed', 'square'); } echo '<span class="posted-on"><i class="fa fa-clock-o"></i>' . $posted_on . '</span><span class="byline"> ' . $byline . '</span><span class="comment-count"><i class="fa fa-comments-o"></i>' . $comment_link . "</span>"; // WPCS: XSS OK. }
/** * Displays the authors Twitter account. */ public function author_twitter() { $twitter = trim(get_the_author_meta('twitter')); if ($twitter && !empty($twitter)) { echo '<meta name="twitter:creator" content="@' . $twitter . '"/>' . "\n"; } }
function argo_staff_fields($user) { ?> <h3>Argo User Settings</h3> <table class="form-table"> <tr> <th><label for="argo_twitter">Twitter username</label></th> <td> <input type="text" name="argo_twitter" id="argo_twitter" value="<?php echo esc_attr(get_the_author_meta('argo_twitter', $user->ID)); ?> " class="regular-text" /><br /> <span class="description">Please enter your Twitter username</span> </td> </tr> <tr> <th>Blog Host?</th> <td> <input type="checkbox" name="argo_is_staff" id="argo_is_staff" value="1" <?php checked(1, get_the_author_meta('argo_is_staff', $user->ID)); ?> /> <label for="argo_is_staff">Yes</label><br /> <span class="description">Blog hosts appear in the blog host widget.</span> </td> </tr> </table> <?php }
function jrd_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; //print_r($comment); /* Check if post is by Author for special styling */ $isByAuthor = false; if ($comment->comment_author_email == get_the_author_meta('email')) { $isByAuthor = true; } ?> <li class="clearfix"> <div class="author"> <h6><?php echo $comment->comment_author; ?> </h6> <p class="timestamp"><?php printf(__('%1$s at %2$s'), get_comment_date('n/j/Y'), get_comment_time('g:ia')); ?> </p> </div> <div class="commenttext"> <?php comment_text(); ?> </div> </li> <?php }
function roots_entry_meta() { echo '<div id="author-info">'; echo '<time class="updated" datetime="' . get_the_time('c') . '" pubdate>' . sprintf(__('Posted on %s at %s.', 'roots'), get_the_date(), get_the_time()) . '</time>'; echo '<p class="byline author vcard">' . __('Written by', 'roots') . ' <a href="' . get_author_posts_url(get_the_author_meta('id')) . '" rel="author" class="fn">' . get_the_author() . '</a></p>'; echo '</div>'; }
function matraman_lite_author() { global $post; echo '<span class="author"> <i class="icon icon-gist-secret"></i>'; echo '<a href="' . get_author_posts_url(get_the_author_meta('ID')) . '">' . get_the_author_meta('display_name') . '</a>'; echo '</span> |'; }
/** * Single product meta */ public static function sold_by_meta() { $vendor_id = get_the_author_meta('ID'); $sold_by_label = WC_Vendors::$pv_options->get_option('sold_by_label'); $sold_by = WCV_Vendors::is_vendor($vendor_id) ? sprintf('<a href="%s" class="wcvendors_cart_sold_by_meta">%s</a>', WCV_Vendors::get_vendor_shop_page($vendor_id), WCV_Vendors::get_vendor_sold_by($vendor_id)) : get_bloginfo('name'); echo apply_filters('wcvendors_cart_sold_by_meta', $sold_by_label) . $sold_by . '<br/>'; }
/** * Prints HTML with meta information for the categories, tags and comments. */ function ushipnetwork_entry_footer() { // Hide category and tag text for pages. if ('post' === get_post_type()) { $byline = sprintf(esc_html_x('by %s', 'post author', 'ushipnetwork'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>'); echo '<div class="byline">' . '<div class="authorship">' . $byline . '</div>' . '<div class="share">'; include "share.php"; echo '</div>' . '</div>'; $posttags = get_the_tags(); $count = 0; $separator = ', '; $output = ''; if (!empty($posttags)) { echo '<span class="tag-list">tags: '; foreach ($posttags as $posttag) { $count++; if ($count <= 2) { $output .= '<a href="' . esc_url(get_tag_link($posttag->term_id)) . '" alt="' . esc_attr(sprintf(__('View all posts in %s', 'textdomain'), $posttag->name)) . '">' . esc_html($posttag->name) . '</a>' . $separator; } } echo trim($output, $separator); } echo '</span>'; } edit_post_link(sprintf(esc_html__('Edit %s', 'ushipnetwork'), the_title('<span class="screen-reader-text">"', '"</span>', false)), '<span class="edit-link">', '</span>'); }
function airballoon_display_postmeta() { ?> <span class="meta-date"> <?php printf('<a href="%1$s" title="%2$s" rel="bookmark"><time datetime="%3$s">%4$s</time></a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date())); ?> </span> <span class="meta-author"> <?php printf('<a href="%1$s" title="%2$s" rel="author">%3$s</a>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'airballoon-lite'), get_the_author())), get_the_author()); ?> </span> <?php if (comments_open()) { ?> <span class="meta-comments"> <?php comments_popup_link(__('Leave a comment', 'airballoon-lite'), __('One comment', 'airballoon-lite'), __('% comments', 'airballoon-lite')); ?> </span> <?php } edit_post_link(__('Edit Post', 'airballoon-lite')); }
/** * mur_block_editing_post() * * block post editing for different user */ function mur_block_editing_post() { $author_id_post = get_the_author_meta('ID'); $current_user = wp_get_current_user(); $author_role = $current_user->roles[0]; $author_id = $current_user->ID; }
/** * add the ad meta in the loop after the ad title * @since 3.1 */ function cp_ad_loop_meta() { if (is_page() || is_singular(APP_POST_TYPE)) { return; } // don't do ad-meta on pages global $post; if ($post->post_type == 'page') { return; } ?> <p class="post-meta"> <span class="folder"><?php if ($post->post_type == 'post') { the_category(', '); } else { echo get_the_term_list($post->ID, APP_TAX_CAT, '', ', ', ''); } ?> </span> | <span class="owner"><?php if (get_option('cp_ad_gravatar_thumb') == 'yes') { appthemes_get_profile_pic(get_the_author_meta('ID'), get_the_author_meta('user_email'), 16); } the_author_posts_link(); ?> </span> | <span class="clock"><span><?php echo appthemes_date_posted($post->post_date); ?> </span></span> </p> <?php }
function uw_blogroll_shortcode($atts = array()) { //allow pagebuilder widgets to run the shortcode, block all other posts to prevent infinite loops if (get_post_type() == 'post' && !is_home()) { return ''; } $params = array_merge(array('excerpt' => 'true', 'trim' => 'false', 'image' => 'hide', 'author' => 'show', 'titletag' => 'h2', 'number' => 5), $atts); if (!array_key_exists('numberposts', $params)) { $params['numberposts'] = $params['number']; } $posts = get_posts($params); foreach ($posts as $post) { if (!stripos($post->post_content, '[blogroll')) { //to prevent infinite loops in pagebuilder widgets $postID = $post->ID; $link = get_permalink($postID); if (in_array($params['excerpt'], array('show', 'true'))) { $excerpt = strlen($post->post_excerpt) > 0 ? $post->post_excerpt : apply_filters('widget_text', $post->post_content); if (in_array($params['trim'], array('show', 'true'))) { $excerpt = wp_trim_words($excerpt); } $excerpt = wpautop($excerpt); //using apply_filters('the_content', $excerpt) causes an infinite loop if (in_array($params['image'], array('show', 'true'))) { $image = get_the_post_thumbnail($postID, 'thumbnail', array('style' => 'float:left;padding-right:10px;')); $class = 'class="pull-left"'; } } $author = $params['author'] === 'show' ? '<p class="author-info">' . get_the_author_meta('display_name', $post->post_author) . '</p>' : ''; $postDate = get_the_time(get_option('date_format'), $postID); $html .= "<li {$class}>{$image}<span><p class=\"date\">{$postDate}</p><" . $params['titletag'] . "><a href=\"{$link}\">{$post->post_title}</a></" . $params['titletag'] . ">{$author}{$excerpt}</span></li>"; } } return "<ul class=\"shortcode-blogroll\">{$html}</ul>"; }
function qum_yim_handler($output, $form_location, $field, $user_id, $field_check_errors, $request_data) { $item_title = apply_filters('qum_' . $form_location . '_yim_item_title', qum_icl_t('plugin quick-user-manager-pro', 'default_field_' . $field['id'] . '_title_translation', $field['field-title'])); $item_description = qum_icl_t('plugin quick-user-manager-pro', 'default_field_' . $field['id'] . '_description_translation', $field['description']); $input_value = ''; if ($form_location == 'edit_profile') { $input_value = get_the_author_meta('yim', $user_id); } if (trim($input_value) == '') { $input_value = $field['default-value']; } $input_value = isset($request_data['yim']) ? trim($request_data['yim']) : $input_value; if ($form_location != 'back_end') { $error_mark = $field['required'] == 'Yes' ? '<span class="qum-required" title="' . qum_required_field_error($field["field-title"]) . '">*</span>' : ''; if (array_key_exists($field['id'], $field_check_errors)) { $error_mark = '<img src="' . QUM_PLUGIN_URL . 'assets/images/pencil_delete.png" title="' . qum_required_field_error($field["field-title"]) . '"/>'; } $output = ' <label for="yim">' . $item_title . $error_mark . '</label> <input class="text-input" name="yim" maxlength="' . apply_filters('qum_maximum_character_length', 70) . '" type="text" class="default_field_yim" id="yim" value="' . esc_attr(wp_unslash($input_value)) . '" />'; if (!empty($item_description)) { $output .= '<span class="qum-description-delimiter">' . $item_description . '</span>'; } } return apply_filters('qum_' . $form_location . '_yim', $output, $form_location, $field, $user_id, $field_check_errors, $request_data); }
/** * Render Wish List Columns * * @since 1.0 * @param string $column_name Column name * @param int $post_id Download (Post) ID * @return void */ function edd_wl_render_admin_columns($column_name, $post_id) { if (get_post_type($post_id) == 'edd_wish_list') { $items = get_post_meta(get_the_ID(), 'edd_wish_list', true); switch ($column_name) { case 'downloads': if ($items) { echo count($items); } else { echo 0; } break; case 'total': echo edd_wl_get_list_total(get_the_ID()); break; case 'list_author': $post = get_post(); if (0 == $post->post_author) { echo __('Guest', 'edd-wish-lists'); } else { printf('<a href="%s">%s</a>', esc_url(add_query_arg(array('post_type' => $post->post_type, 'author' => get_the_author_meta('ID')), 'edit.php')), get_the_author()); } break; } } }
function thirdrail_entry_meta() { echo '<div class="entry-meta">'; echo '<p class="byline"><a href="' . get_author_posts_url(get_the_author_meta('ID')) . '" rel="author" class="author">' . get_the_author() . '</a>' . cats() . '</p>'; echo '<time class="updated date" datetime="' . get_the_time('c') . '">' . sprintf(__('%s', 'thirdrail'), get_the_date()) . '</time>'; echo '</div>'; }
/** * Echo the widget content. * * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget */ function widget($args, $instance) { extract($args); //* Merge with defaults $instance = wp_parse_args((array) $instance, $this->defaults); echo $before_widget; if (!empty($instance['title'])) { echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title; } $text = ''; if (!empty($instance['alignment'])) { $text .= '<span class="align' . esc_attr($instance['alignment']) . '">'; } $text .= get_avatar($instance['user'], $instance['size']); if (!empty($instance['alignment'])) { $text .= '</span>'; } if ('text' === $instance['author_info']) { $text .= $instance['bio_text']; } else { $text .= get_the_author_meta('description', $instance['user']); } $text .= $instance['page'] ? sprintf(' <a class="pagelink" href="%s">%s</a>', get_page_link($instance['page']), $instance['page_link_text']) : ''; //* Echo $text echo wpautop($text); //* If posts link option checked, add posts link to output if ($instance['posts_link']) { printf('<div class="posts_link posts-link"><a href="%s">%s</a></div>', get_author_posts_url($instance['user']), __('View My Blog Posts', 'genesis')); } echo $after_widget; }
public function __construct($wpUser) { $this->id = $wpUser->ID; if (function_exists('get_wp_user_avatar_src')) { if (strlen(get_wp_user_avatar_src($this->id, 'original')) > 0) { $this->image = get_wp_user_avatar_src($this->id, 'original'); } } if (!strlen($this->image) > 0) { $this->image = 'http://grafikk.ukm.no/placeholder/person.jpg'; } $this->company_name = get_the_author_meta('title', $this->id); $this->login = $wpUser->user_login; $this->nicename = $wpUser->nicename; $this->user_email = $wpUser->user_email; $this->url = $wpUser->url; $this->registered = $wpUser->registered; $this->display_name = $wpUser->display_name; $this->firstname = $wpUser->firstname; $this->lastname = $wpUser->lastname; $this->nickname = $wpUser->nickname; $this->description = $wpUser->description; $this->facebook_url = get_the_author_meta('facebook', $this->id); $this->title = get_the_author_meta('Title', $this->id); $this->link = get_author_posts_url($this->id, $this->nicename); }
function test_get_the_author_meta_no_authordata() { unset($GLOBALS['authordata']); $this->assertEquals('', get_the_author_meta('id')); $this->assertEquals('', get_the_author_meta('user_login')); $this->assertEquals('', get_the_author_meta('does_not_exist')); }
/** * This action adds a separate section of fields on the user profile * * @param $user */ function allonsy_extra_profile_fields($user) { ?> <h3>Extra Profile Information</h3> <table class="form-table"> <tr> <th><label for="allonsy-user-text-field"><?php _e('Text field', 'allons-y'); ?> </label></th> <td> <select name="allonsy_text_field" id="allonsy-user-text-field"> <?php echo allonsy_build_options(array('one' => __('One', 'allons-y'), 'two' => __('Two', 'allons-y'), 'three' => __('Three', 'allons-y')), 'Select one ...', get_the_author_meta('allonsy_text_field', $user->ID)); ?> </select> </td> </tr> <tr> <th><label for="allonsy-user-checkbox"><?php _e('Checkbox', 'allons-y'); ?> </label></th> <td> <input type="checkbox" name="allonsy_checkbox" id="allonsy-user-checkbox" value="1" <?php checked(1, get_the_author_meta('allonsy_checkbox', $user->ID)); ?> > </td> </tr> </table> <?php }
function widget($args, $instance) { extract($args); echo $before_widget; ?> <div class="zan-author text-center hidden-xs"> <div class="author-top"></div> <div class="author-bottom"> <?php echo get_avatar(get_the_author_meta('email'), '120'); ?> <div class="author-content"> <span class="author-name"><?php echo get_the_author_meta('display_name'); ?> </span> <span class="author-social"> <div class="btn-group btn-group-justified"> <a class="btn btn-zan-solid-wi" target="_blank" href="<?php echo get_the_author_meta('sina_weibo'); ?> "><i class="fa fa-weibo"></i> 新浪微博</a> <a class="btn btn-zan-solid-wi" target="_blank" href="<?php echo get_the_author_meta('tencent_weibo'); ?> "><i class="fa fa-tencent-weibo"></i> 腾讯微博</a> </div> </span> </div> </div> </div> <?php echo $after_widget; }
/** * Echo the widget content. * * @param array $args Display arguments including `before_title`, `after_title`, * `before_widget`, and `after_widget`. * @param array $instance The settings for the particular instance of the widget. */ function widget($args, $instance) { // Merge with defaults. $instance = wp_parse_args((array) $instance, $this->defaults); echo $args['before_widget']; if (!empty($instance['title'])) { echo $args['before_title'] . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $args['after_title']; } $text = ''; if (!empty($instance['alignment'])) { $text .= '<span class="align' . esc_attr($instance['alignment']) . '">'; } $text .= get_avatar($instance['user'], $instance['size']); if (!empty($instance['alignment'])) { $text .= '</span>'; } if ('text' === $instance['author_info']) { $text .= $instance['bio_text']; } else { $text .= get_the_author_meta('description', $instance['user']); } $text .= $instance['page'] ? sprintf(' <a class="pagelink" href="%s">%s</a>', get_page_link($instance['page']), $instance['page_link_text']) : ''; echo wpautop($text); // If posts link option checked, add posts link to output. $display_name = get_the_author_meta('display_name', $instance['user']); $user_name = !empty($display_name) && genesis_a11y('screen-reader-text') ? '<span class="screen-reader-text">' . $display_name . ': </span>' : ''; if ($instance['posts_link']) { printf('<div class="posts_link posts-link"><a href="%s">%s%s</a></div>', get_author_posts_url($instance['user']), $user_name, __('View My Blog Posts', 'genesis')); } echo $args['after_widget']; }
/** * Prints HTML with meta information for the current post-date/time, author, comment count and categories. */ function ultra_posted_on() { echo '<div class="entry-meta-inner">'; if (is_sticky() && is_home() && !is_paged()) { echo '<span class="featured-post">' . __('Sticky', 'ultra') . '</span>'; } if (is_home() && siteorigin_setting('blog_post_date') || is_archive() && siteorigin_setting('blog_post_date') || is_search() && siteorigin_setting('blog_post_date')) { echo '<span class="entry-date"><a href="' . esc_url(get_permalink()) . '" rel="bookmark"><time class="published" datetime="' . esc_attr(get_the_date('c')) . '">' . esc_html(get_the_date('j F Y')) . '</time><time class="updated" datetime="' . esc_attr(get_the_modified_date('c')) . '">' . esc_html(get_the_modified_date()) . '</time></span></a>'; } if (is_single() && siteorigin_setting('blog_post_date')) { echo '<span class="entry-date"><time class="published" datetime="' . esc_attr(get_the_date('c')) . '">' . esc_html(get_the_date('j F Y')) . '</time><time class="updated" datetime="' . esc_attr(get_the_modified_date('c')) . '">' . esc_html(get_the_modified_date()) . '</time></span>'; } if (siteorigin_setting('blog_post_author')) { echo '<span class="byline"><span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '" rel="author">' . esc_html(get_the_author()) . '</a></span></span>'; } if (comments_open() && siteorigin_setting('blog_post_comment_count')) { echo '<span class="comments-link">'; comments_popup_link(__('Leave a comment', 'ultra'), __('1 Comment', 'ultra'), __('% Comments', 'ultra')); echo '</span>'; } echo '</div>'; if (is_single() && siteorigin_setting('navigation_post_nav')) { the_post_navigation($args = array('prev_text' => '', 'next_text' => '')); } }
function sf_custom_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; $GLOBALS['comment_depth'] = $depth; ?> <li id="comment-<?php comment_ID(); ?> " <?php comment_class('clearfix'); ?> > <div class="comment-wrap clearfix"> <div class="comment-avatar"> <?php if (function_exists('get_avatar')) { echo get_avatar($comment, '100'); } ?> <?php if ($comment->comment_author_email == get_the_author_meta('email')) { ?> <span class="tooltip"><?php _e("Author", "swiftframework"); ?> <span class="arrow"></span></span> <?php } ?> </div> <div class="comment-content"> <div class="comment-meta"> <?php printf('<span class="comment-author">%1$s</span> <span class="comment-date">%2$s</span>', get_comment_author_link(), human_time_diff(get_comment_time('U'), current_time('timestamp')) . ' ' . __("ago", "swiftframework")); ?> <div class="comment-meta-actions"> <?php edit_comment_link(__('Edit', 'swiftframework'), '<span class="edit-link">', '</span><span class="meta-sep"> |</span>'); ?> <?php if ($args['type'] == 'all' || get_comment_type() == 'comment') { comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'swiftframework'), 'login_text' => __('Log in to reply.', 'swiftframework'), 'depth' => $depth, 'before' => '<span class="comment-reply">', 'after' => '</span>'))); } ?> </div> </div> <?php if ($comment->comment_approved == '0') { _e("\t\t\t\t\t<span class='unapproved'>Your comment is awaiting moderation.</span>\n", 'swiftframework'); } ?> <div class="comment-body"> <?php comment_text(); ?> </div> </div> </div> <?php }
function wppb_description_handler($output, $form_location, $field, $user_id, $field_check_errors, $request_data) { $item_title = apply_filters('wppb_' . $form_location . '_description_item_title', wppb_icl_t('plugin profile-builder-pro', 'default_field_' . $field['id'] . '_title_translation', $field['field-title'])); $item_description = wppb_icl_t('plugin profile-builder-pro', 'default_field_' . $field['id'] . '_description_translation', $field['description']); $input_value = ''; if ($form_location == 'edit_profile') { $input_value = get_the_author_meta('description', $user_id); } if (trim($input_value) == '') { $input_value = $field['default-value']; } $input_value = isset($request_data['description']) ? trim($request_data['description']) : $input_value; $extra_attr = apply_filters('wppb_extra_attribute', '', $field); if ($form_location != 'back_end') { $error_mark = $field['required'] == 'Yes' ? '<span class="wppb-required" title="' . wppb_required_field_error($field["field-title"]) . '">*</span>' : ''; if (array_key_exists($field['id'], $field_check_errors)) { $error_mark = '<img src="' . WPPB_PLUGIN_URL . 'assets/images/pencil_delete.png" title="' . wppb_required_field_error($field["field-title"]) . '"/>'; } $output = ' <label for="description">' . $item_title . $error_mark . '</label> <textarea rows="' . $field['row-count'] . '" name="description" maxlength="' . apply_filters('wppb_maximum_character_length', '', $field) . '" class="default_field_description" id="description" wrap="virtual" ' . $extra_attr . '>' . esc_textarea(wp_unslash($input_value)) . '</textarea>'; if (!empty($item_description)) { $output .= '<span class="wppb-description-delimiter">' . $item_description . '</span>'; } } return apply_filters('wppb_' . $form_location . '_description', $output, $form_location, $field, $user_id, $field_check_errors, $request_data); }
function widget() { // Check if obj exists in cache $users = wp_cache_get('active_users'); if ($users == false) { // Generate the query $users = get_users(array('role' => 'student')); // Cache the results wp_cache_set('active_users', $users, '', 300); } //$users = get_users( array( 'role' => 'student' ) ); $users_for_counts = array(); foreach ($users as $user) { $users_for_counts[] = $user->ID; } // Check if obj exists in cache $counts = wp_cache_get('user_count'); if ($counts == false) { // Generate the obj $counts = count_many_users_posts($users_for_counts); // Cache the results wp_cache_set('user_count', $counts, '', 300); } arsort($counts); $counts = array_slice($counts, 0, 5, true); echo 'There are currently <strong>' . intval(count($users)) . '</strong> students with HS Insider accounts.'; echo '<p><strong>Most-active students:</strong></p><ul>'; foreach ($counts as $user_id => $count) { echo '<li><a href="' . esc_url(get_author_posts_url($user_id)) . '" target=_blank>' . esc_html(get_the_author_meta('display_name', $user_id)) . '</a>: (<strong>' . intval($count) . '</strong>)</li>'; } echo '</ul>'; }
/** * @see CPAC_Column::get_value() * @since 2.4.7 */ public function get_value($id) { $raw_value = $this->get_raw_value($id); // Get page to link to switch ($this->get_option('post_link_to')) { case 'edit_post': $link = get_edit_post_link($raw_value); break; case 'view_post': $link = get_permalink($raw_value); break; case 'edit_author': $link = get_edit_user_link(get_post_field('post_author', $raw_value)); break; case 'view_author': $link = get_author_posts_url(get_post_field('post_author', $raw_value)); break; } // Get property of post to display switch ($this->get_option('post_property_display')) { case 'author': $label = get_the_author_meta('display_name', get_post_field('post_author', $raw_value)); break; case 'id': $label = $raw_value; break; default: $label = get_the_title($raw_value); break; } $value = $link ? "<a href='{$link}'>{$label}</a>" : $label; return $value; }
function check_follow($matches) { #support of "meta=follow" option for admins. disabled by default to minify processing. if (!$this->options['dont_mask_admin_follow']) { return false; } $id = array(get_comment_ID(), get_the_ID()); //it is either page or post if ($id[0]) { $this->debug_info('It is a comment. id ' . $id[0]); } elseif ($id[1]) { $this->debug_info('It is a page. id ' . $id[1]); } $author = false; if ($id[0]) { $author = get_comment_author($id[0]); } else { if ($id[1]) { $author = get_the_author_meta('ID'); } } if (!$author) { $this->debug_info('it is neither post or page, applying usual rules'); } elseif (user_can($author, 'manage_options') && (stripos($matches[0], 'rel="follow"') !== FALSE || stripos($matches[0], "rel='follow'") !== FALSE)) { $this->debug_info('This link has a follow atribute and is posted by admin, not masking it.'); #wordpress adds rel="nofollow" by itself when posting new link in comments. get rid of it! Also, remove our follow attibute - it is unneccesary. return str_ireplace(array('rel="follow"', "rel='follow'", 'rel="nofollow"'), '', $matches[0]); } else { $this->debug_info('it does not have rel follow or is not posted by admin, masking it'); } return false; }