function presscore_search_title_shortcode()
 {
     $title = '';
     $wrap_class = '';
     if (is_search()) {
         $title = get_search_query();
     } else {
         if (is_archive()) {
             if (is_category()) {
                 $title = single_cat_title('', false);
             } elseif (is_tag()) {
                 $title = single_tag_title('', false);
             } elseif (is_author()) {
                 the_post();
                 $title = '<a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta("ID"))) . '" title="' . esc_attr(get_the_author()) . '" rel="me">' . get_the_author() . '</a>';
                 $wrap_class .= ' vcard';
                 rewind_posts();
             } elseif (is_day()) {
                 $title = '<span>' . get_the_date() . '</span>';
             } elseif (is_month()) {
                 $title = '<span>' . get_the_date('F Y');
             } elseif (is_year()) {
                 $title = '<span>' . get_the_date('Y');
             } elseif (is_tax('dt_portfolio_category')) {
                 $title = single_term_title('', false);
             } elseif (is_tax('dt_gallery_category')) {
                 $title = single_term_title('', false);
             }
         }
     }
     if ($title) {
         $title = '<span' . ($wrap_class ? ' class="' . esc_attr($wrap_class) . '"' : '') . '>' . $title . '</span>';
     }
     return $title;
 }
 /**
  * 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.
 }
Example #3
0
 /**
  * @return string
  */
 public function get_link()
 {
     if (!$this->_link) {
         $this->_link = untrailingslashit(get_author_posts_url($this->ID));
     }
     return $this->_link;
 }
 protected function __output()
 {
     $musicas = array();
     if ($this->property['exibir'] == 'selecionadas') {
         $musicas = $this->property['musicas'];
     } else {
         $musicas_full = tnb_get_artista_musicas($this->user_id);
         foreach ($musicas_full as $m) {
             $musicas[] = $m->ID;
         }
     }
     if (sizeof($musicas) > 0) {
         printFullPlayer(ids2playlist($musicas));
     } else {
         if ($this->editable()) {
             ?>
         <div class="tnb_add_box_icons">
             <p class="text-center bottom">
                 <?php 
             _e("Você ainda não tem nenhuma música! Clique <a href='" . get_author_posts_url($this->user_id) . "/editar/musicas/'>aqui</a> para carregá-las", "tnb");
             ?>
             </p>
         </div>
     <?php 
         }
     }
 }
Example #5
0
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>    |';
}
 function get_user_url($user)
 {
     if (function_exists('bp_core_get_user_domain')) {
         return bp_core_get_user_domain($user);
     }
     return get_author_posts_url($user);
 }
Example #7
0
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>';
}
Example #8
0
 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 twentyten_posted_on()
{
    $meta = array();
    $meta['author'] = sprintf(__('%1$s <span class="meta-sep">by</span> %2$s', 'wordcampbase'), sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>', get_permalink(), esc_attr(get_the_time()), get_the_date()), sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', get_author_posts_url(get_the_author_meta('ID')), sprintf(esc_attr__('View all posts by %s', 'wordcampbase'), get_the_author()), get_the_author()));
    $meta['sep'] = ' <span class="meta-sep meta-sep-bull">&bull;</span> ';
    $meta['comments'] = array('before' => '<span class="comments-link">', 'after' => '</span>', 'zero' => __('Leave a comment', 'wordcampbase'), 'one' => __('1 Comment', 'wordcampbase'), 'many' => __('% Comments', 'wordcampbase'));
    $meta['edit'] = array('title' => __('Edit', 'wordcampbase'), 'before' => '<span class="edit-link">', 'after' => '</span>');
    $meta['br'] = '<br />';
    // Just to have.
    $meta['order'] = array('author', 'sep', 'comments', 'edit');
    $meta = apply_filters('wcb_entry_meta', $meta);
    if (!is_array($meta) || !isset($meta['order'])) {
        return;
    }
    foreach ($meta['order'] as $type) {
        $content = $meta[$type];
        switch ($type) {
            case 'comments':
                echo $content['before'];
                comments_popup_link($content['zero'], $content['one'], $content['many']);
                echo $content['after'];
                break;
            case 'edit':
                if (isset($meta['sep'])) {
                    $content['before'] = $meta['sep'] . $content['before'];
                }
                edit_post_link($content['title'], $content['before'], $content['after']);
                break;
            default:
                echo $content;
        }
    }
}
Example #10
0
 public function tags()
 {
     if (!did_action('pre_get_posts')) {
         return array();
     }
     $queried_object = get_queried_object();
     $tags = array();
     $default_tags = array('og:type' => 'website', 'og:locale' => get_locale(), 'og:site_name' => get_bloginfo('name'), 'og:image' => $this->get_image_url());
     if (is_front_page()) {
         $tags = array('og:url' => home_url('/'), 'og:title' => get_bloginfo('name'), 'og:description' => get_bloginfo('description'));
     } else {
         if (is_singular()) {
             $tags = array('og:type' => 'article', 'og:url' => get_permalink($queried_object), 'og:title' => get_the_title($queried_object), 'og:description' => $this->generate_preview($queried_object->post_content), 'article:published_time' => date('c', strtotime($queried_object->post_date_gmt)), 'article:modified_time' => date('c', strtotime($queried_object->post_modified_gmt)), 'article:author' => get_author_posts_url($queried_object->post_author));
         } else {
             if (is_tax() || is_category() || is_tag()) {
                 $tags = array('og:url' => get_term_link($queried_object), 'og:title' => $queried_object->name, 'og:description' => $this->generate_preview($queried_object->description));
             } else {
                 if (is_author()) {
                     $tags = array('og:type' => 'profile', 'og:url' => get_author_posts_url($queried_object->ID), 'og:title' => $queried_object->display_name, 'og:description' => $this->generate_preview($queried_object->user_description), 'profile:first_name' => get_the_author_meta('first_name', $queried_object->ID), 'profile:last_name' => get_the_author_meta('last_name', $queried_object->ID));
                 }
             }
         }
     }
     $tags = array_merge($default_tags, $tags);
     return apply_filters('appthemes_open_graph_meta_tags', $tags);
 }
function fulgent_entry_meta()
{
    $fulgent_category_list = get_the_category_list(', ', ' ');
    $fulgent_tag_list = get_the_tag_list('<li>' . __('Tags : ', 'fulgent'), ', ', ' ' . '</li>');
    $fulgent_date = sprintf('<time datetime="%1$s">%2$s</time>', esc_attr(get_the_date('c')), esc_html(get_the_date()));
    $fulgent_author = sprintf('<a href="%1$s" title="%2$s" >%3$s</a>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'fulgent'), get_the_author())), get_the_author());
    if ($fulgent_tag_list) {
        $fulgent_utility_text = '<div class="post-meta"><ul>
			<li> ' . __('by', 'fulgent') . ' : %4$s </li>	
			<li>' . __('Posted in', 'fulgent') . ' : %1$s </li>
			%2$s 
			<li> ' . fulgent_comment_number_custom() . '</li>
			</ul>
		</div>';
    } elseif ($fulgent_category_list) {
        $fulgent_utility_text = '<div class="post-meta"><ul>
			<li>' . __('by', 'fulgent') . ' : %4$s</li>
			<li>' . __('Posted in', 'fulgent') . ' : %1$s </li>
			 %2$s  
			<li>' . fulgent_comment_number_custom() . '</li>
			</ul>
		</div>';
    } else {
        $fulgent_utility_text = '<div class="post-meta"><ul>
			<li>' . __('by', 'fulgent') . ' : %4$s </li>
			<li>' . __('Posted on', 'fulgent') . ' : %3$s </li>
			 %2$s 
			<li>' . fulgent_comment_number_custom() . '</li>
			</ul>
		</div>';
    }
    printf($fulgent_utility_text, $fulgent_category_list, $fulgent_tag_list, $fulgent_date, $fulgent_author);
}
    function shaped_blog_posted_on()
    {
        ?>

            <ul class="list-inline">
                <li>
                    <span class="author vcard">
                        <?php 
        _e('By ', 'shaped-blog');
        printf('<a class="url fn n" href="%1$s">%2$s</a>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_html(get_the_author()));
        ?>
                    </span>
                </li>
                <li>
                    on <span class="posted-on"><?php 
        the_time('M d, Y');
        ?>
</span>
                </li>
                <?php 
        if (get_the_category_list()) {
            ?>
                    <li>
                        in <span class="posted-in">
                            <?php 
            echo get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'shaped-blog'));
            ?>
                        </span>
                    </li>
                <?php 
        }
        ?>
            </ul>
        <?php 
    }
Example #13
0
 function redwaves_entry_author()
 {
     if ('post' == get_post_type()) {
         $byline = sprintf(_x('%s', 'post author', 'redwaves-lite'), '<span class="author vcard"><span class="url fn"><a href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span></span>');
         echo '<span class="theauthor"><i class="fa fa-user"></i> ' . $byline . '</span>';
     }
 }
Example #14
0
/**
 * Echo post meta author shortcode.
 *
 * @since 1.0.0
 */
function beans_post_meta_author_shortcode()
{
    beans_output('beans_post_meta_author_prefix', __('By ', 'beans'));
    echo beans_open_markup('beans_post_meta_author', 'a', array('href' => esc_url(get_author_posts_url(get_the_author_meta('ID')))));
    echo beans_output('beans_post_meta_author_text', get_the_author());
    echo beans_close_markup('beans_post_meta_author', 'a');
}
/**
 * This is a duplicate of the above. Probably delete others
 */
function kanec_entry_meta()
{
    // Time
    $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()));
    echo '<div class="posted-on"><i class="icon icon-calendar-o"></i><a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a></div>';
    // Author
    echo '<div class="byline"><i class="icon icon-user"></i><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></div>';
    // Categories & Tags
    // Hide category and tag text for pages.
    if ('post' === get_post_type()) {
        /* translators: used between list items, there is a space after the comma */
        $categories_list = get_the_category_list(esc_html__(', ', 'kanec'));
        if ($categories_list && kanec_categorized_blog()) {
            echo '<div class="cat-links"><i class="icon icon-folder-open"></i>' . $categories_list . '</div>';
        }
        /* translators: used between list items, there is a space after the comma */
        $tags_list = get_the_tag_list('', esc_html__(', ', 'kanec'));
        if ($tags_list) {
            echo '<div class="tags-links"><i class="icon icon-tags"></i>' . $tags_list . '</div>';
        }
    }
    if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
        echo '<div class="comments-link"><i class="icon icon-comments"></i>';
        comments_popup_link(esc_html__('Leave a comment', 'kanec'), esc_html__('1 Comment', 'kanec'), esc_html__('% Comments', 'kanec'));
        echo '</div>';
    }
}
Example #16
0
 /**
  * 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 widget($args, $instance)
 {
     extract($args, EXTR_SKIP);
     $instance = wp_parse_args((array) $instance, array('title' => __('Blog Authors', 'academy'), 'number' => '6', 'order' => 'registered'));
     $orderdir = 'DESC';
     if ($instance['order'] == 'display_name') {
         $orderdir = 'ASC';
     }
     $title = apply_filters('widget_title', empty($instance['title']) ? __('Blog Authors', 'academy') : $instance['title'], $instance, $this->id_base);
     $out = $before_widget;
     $out .= $before_title . $title . $after_title;
     $counter = 0;
     $users = get_users(array('number' => $instance['number'], 'orderby' => $instance['order'], 'order' => $orderdir));
     $out .= '<div class="users-listing">';
     foreach ($users as $user) {
         $name = trim($user->first_name . ' ' . $user->last_name);
         $counter++;
         $out .= '<div class="user-image ';
         if ($counter == 3) {
             $out .= 'last';
         }
         $out .= '"><div class="bordered-image">';
         $out .= '<a title="' . $name . '" href="' . get_author_posts_url($user->ID) . '">' . get_avatar($user->ID) . '</a>';
         $out .= '</div></div>';
         if ($counter == 3) {
             $out .= '<div class="clear"></div>';
             $counter = 0;
         }
     }
     $out .= '</div>';
     $out .= $after_widget;
     echo $out;
 }
Example #18
0
function shortcode_list_posts($atts, $content = null)
{
    extract(shortcode_atts(array('posts_per_page' => -1, 'cat' => '', 'tag' => '', 'order' => '', 'order_by' => ''), $atts));
    $args = array('post_type' => 'post', 'posts_per_page' => $posts_per_page, 'post_status' => 'publish');
    if (!empty($cat)) {
        $cat = split(',', str_replace(" ", "", $cat));
        $args['category__and'] = $cat;
    }
    if (!empty($tag)) {
        $tag = split(',', str_replace(" ", "", $tag));
        $args['tag__in'] = $tag;
    }
    if ($order) {
        $args['order'] = $order;
    }
    if ($order_by) {
        $args['orderby'] = $order_by;
    }
    $my_query = new WP_Query();
    $my_query->query($args);
    $content = '<ul class="post-list" >';
    while ($my_query->have_posts()) {
        $my_query->the_post();
        $author = get_the_author_meta('display_name');
        $author_url = get_author_posts_url(get_the_author_meta('ID'));
        $content .= '<li><a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a> <span>- by <a href="' . $author_url . '" title="' . $author . '">' . $author . '</a> on ' . get_the_time('F j, Y') . '</span></li>' . "\n";
    }
    $content .= '</ul><!-- end .post-list -->';
    //wp_reset_query();
    return remove_wpautop($content);
}
 /**
  * Outputs the widget based on the arguments input through the widget controls.
  *
  * @since  0.1.0
  * @access public
  * @param  array  $sidebar
  * @param  array  $instance
  * @return void
  */
 function widget($sidebar, $instance)
 {
     $instance = wp_parse_args($instance, $this->defaults);
     // Set up the arguments for get_users().
     $args = array('role' => $instance['role'], 'meta_key' => $instance['meta_key'], 'meta_value' => $instance['meta_value'], 'include' => !empty($instance['include']) ? explode(',', $instance['include']) : '', 'exclude' => !empty($instance['exclude']) ? explode(',', $instance['exclude']) : '', 'search' => $instance['search'], 'orderby' => $instance['orderby'], 'order' => $instance['order'], 'offset' => !empty($instance['offset']) ? intval($instance['offset']) : '', 'number' => !empty($instance['number']) ? intval($instance['number']) : '');
     // Output the theme's $before_widget wrapper.
     echo $sidebar['before_widget'];
     // If a title was input by the user, display it.
     if ($instance['title']) {
         echo $sidebar['before_title'] . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $sidebar['after_title'];
     }
     // Get users.
     $users = get_users($args);
     // If users were found.
     if (!empty($users)) {
         echo '<ul class="xoxo users">';
         // Loop through each available user, creating a list item with a link to the user's archive.
         foreach ($users as $user) {
             $class = sanitize_html_class("user-{$user->ID}");
             if (is_author($user->ID)) {
                 $class .= ' current-user';
             }
             printf('<li class="%s"><a href="%s">%s</a>', esc_attr($class), esc_url(get_author_posts_url($user->ID, $user->user_nicename)), esc_html($user->display_name));
         }
         echo '</ul>';
     }
     // Close the theme's widget wrapper.
     echo $sidebar['after_widget'];
 }
Example #20
0
 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function jkl_index_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()));
     $byline = sprintf(esc_html('%s'), '<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>');
     if ('chat' === get_post_format() || 'image' === get_post_format() || 'gallery' === get_post_format() || 'audio' === get_post_format() || 'video' === get_post_format()) {
         $string = ucwords(get_post_format());
         $posted_on = $string . ': <a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>';
     } else {
         $posted_on = sprintf(esc_html_x('Date: %s', 'post date', 'jkl'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
     }
     $meta_class = is_single() ? 'format-small-meta' : 'meta-content-index';
     echo '<div class="' . $meta_class . '">';
     echo '<span class="posted-on">' . $posted_on . '</span>';
     // WPCS: XSS OK.
     if (is_single()) {
         echo '<span class="byline">' . $byline . '</span>';
         if (!has_post_format('quote')) {
             jkl_better_taxonomy_listing('category', 1);
         }
     }
     echo '</div><!-- .meta-content-index -->';
 }
 public function get_link()
 {
     if (!$this->_link) {
         $this->_link = get_author_posts_url($this->ID);
     }
     return $this->_link;
 }
Example #22
0
    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'));
    }
Example #23
0
 /**
  * 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'];
 }
Example #24
0
 /**
  * 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' => ''));
     }
 }
Example #25
0
        function query_members()
        {
            global $wpdb;
            $show = isset($attr['show']) ? (int) $attr['show'] : 20;
            $orderby = isset($attr['orderby']) ? trim($attr['orderby']) : 'video';
            $order = isset($attr['order']) ? trim($attr['order']) : 'DESC';
            $user_array = array('number' => $show, 'orderby' => 'post_count', 'order' => 'DESC');
            $users = get_users($user_array);
            if (!empty($users)) {
                foreach ($users as $user) {
                    $user_data = get_user_by('id', $user->ID);
                    $content .= '
	                    <div class="channel-header">
							
							<div class="channel-image"><a href="' . get_author_posts_url($user->ID) . '">' . get_avatar($user->ID) . '</a></div>
							
							<div class="channel-info">
								<h3>' . $user_data->display_name . '</h3>
								
								<span class="channel-item"><strong>' . __('Videos:', 'mars') . '</strong> ' . mars_get_user_postcount($user->ID) . '</span>
								<span class="channel-item"><strong>' . __('Likes:', 'mars') . '</strong> ' . mars_get_user_metacount($user->ID, 'like_key') . '</span>
								<span class="channel-item"><strong>' . __('Views:', 'mars') . '</strong> ' . mars_get_user_metacount($user->ID, 'count_viewed') . '</span>
							</div>
						</div>
					';
                }
            }
            return $content;
        }
Example #26
0
 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;
 }
Example #28
0
 public static function get_vendor_store_url($user = false)
 {
     if (!is_object($user)) {
         if ($user === false) {
             $user = get_current_user_id();
         }
         $user = new WP_User($user);
     }
     if (!$user || !is_object($user)) {
         $user = new WP_User(get_current_user_id());
     }
     $archive_page = EDD_FES()->vendors->use_author_archives();
     $name = get_userdata($user->ID);
     $user_nicename = apply_filters('fes_user_nicename_to_lower', strtolower($name->user_nicename), $user);
     if (empty($archive_page)) {
         $vendor_url = get_permalink(EDD_FES()->helper->get_option('fes-vendor-page', ''));
         $permalink = apply_filters('fes_adjust_vendor_url', untrailingslashit('vendor/'));
         $vendor_url = str_replace('fes-vendor/', $permalink, $vendor_url);
         $vendor_url = str_replace('vendor/', $permalink, $vendor_url);
         if (get_option('permalink_structure')) {
             $vendor_url = trailingslashit($vendor_url) . $user_nicename;
         } else {
             $vendor_url = add_query_arg('vendor', $user_nicename, $vendor_url);
         }
     } else {
         $vendor_url = get_author_posts_url($user->ID, $user_nicename);
     }
     return $vendor_url;
 }
 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>';
 }
Example #30
-1
 /**
  * @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;
 }