本文整理汇总了PHP中get_the_author_meta函数的典型用法代码示例。如果您正苦于以下问题:PHP get_the_author_meta函数的具体用法?PHP get_the_author_meta怎么用?PHP get_the_author_meta使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_the_author_meta函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: square_posted_on
/**
* 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.
}
开发者ID:jgcopple,项目名称:drgaryschwantz,代码行数:29,代码来源:template-tags.php
示例2: comment
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";
// закрываем див
}
开发者ID:Ivan26ru,项目名称:gp-wp,代码行数:30,代码来源:functions.php
示例3: xfac_get_avatar
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;
}
开发者ID:billyprice1,项目名称:bdApi,代码行数:32,代码来源:avatar.php
示例4: argo_staff_fields
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
}
开发者ID:regancarver,项目名称:Argo,代码行数:31,代码来源:users.php
示例5: jrd_comment
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
}
开发者ID:jackrabbit-design,项目名称:itg,代码行数:32,代码来源:functions-comments.php
示例6: roots_entry_meta
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>';
}
开发者ID:nbeecroft,项目名称:roots,代码行数:7,代码来源:template-tags.php
示例7: __construct
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);
}
开发者ID:mariusmandal,项目名称:wpoo,代码行数:26,代码来源:Author.php
示例8: thirdrail_entry_meta
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>';
}
开发者ID:rollandwalsh,项目名称:third-rail-wp,代码行数:7,代码来源:entry-meta.php
示例9: sold_by_meta
/**
* 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/>';
}
开发者ID:GoTeamScotch,项目名称:wcvendors,代码行数:10,代码来源:class-vendor-cart.php
示例10: edd_wl_render_admin_columns
/**
* 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;
}
}
}
开发者ID:SelaInc,项目名称:eassignment,代码行数:34,代码来源:dashboard-columns.php
示例11: mur_block_editing_post
/**
* 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;
}
开发者ID:airton,项目名称:manage-user-roles,代码行数:12,代码来源:manage-user-roles.php
示例12: cp_ad_loop_meta
/**
* 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
}
开发者ID:kalushta,项目名称:darom,代码行数:37,代码来源:theme-actions.php
示例13: uw_blogroll_shortcode
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>";
}
开发者ID:uw-sop,项目名称:htdocs,代码行数:35,代码来源:custom-shortcodes.php
示例14: qum_yim_handler
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);
}
开发者ID:rhinokul,项目名称:quick-user-manager,代码行数:26,代码来源:yim.php
示例15: matraman_lite_author
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> |';
}
开发者ID:ComEnYns,项目名称:Web-Projects,代码行数:7,代码来源:themeta.php
示例16: allonsy_extra_profile_fields
/**
* 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
}
开发者ID:joshcanhelp,项目名称:wp-starter,代码行数:38,代码来源:admin-profile.php
示例17: author_twitter
/**
* 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";
}
}
开发者ID:grff-alpha,项目名称:grff-alpha-web,代码行数:10,代码来源:class-twitter.php
示例18: airballoon_display_postmeta
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'));
}
开发者ID:russtx,项目名称:tac,代码行数:27,代码来源:template-tags.php
示例19: 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)
{
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;
}
开发者ID:treydonovan,项目名称:innergame-anna,代码行数:37,代码来源:user-profile-widget.php
示例20: ushipnetwork_entry_footer
/**
* 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>');
}
开发者ID:rmikeska,项目名称:ushipnetwork,代码行数:29,代码来源:template-tags.php
注:本文中的get_the_author_meta函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论