本文整理汇总了PHP中ap_user_get_the_meta函数的典型用法代码示例。如果您正苦于以下问题:PHP ap_user_get_the_meta函数的具体用法?PHP ap_user_get_the_meta怎么用?PHP ap_user_get_the_meta使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ap_user_get_the_meta函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ap_get_user_fields
function ap_get_user_fields($group = 'basic', $user_id = false)
{
if (!$user_id) {
$user_id = get_current_user_id();
}
$fields_value = ap_user_get_the_meta(false, $user_id);
$form_fields = array();
$form_fields['basic'] = array(array('name' => 'hide_profile', 'label' => __('Hide my profile', 'anspress-question-answer'), 'type' => 'checkbox', 'desc' => __('Hide your profile from public', 'anspress-question-answer'), 'value' => $fields_value['hide_profile'], 'order' => 5, 'autocomplete' => false, 'sanitize' => array('strip_tags', 'sanitize_text_field'), 'show_desc_tip' => false), array('name' => 'first_name', 'label' => __('First name', 'anspress-question-answer'), 'type' => 'text', 'placeholder' => __('Your first name', 'anspress-question-answer'), 'value' => $fields_value['first_name'], 'order' => 5, 'autocomplete' => false, 'sanitize' => array('strip_tags', 'sanitize_text_field')), array('name' => 'last_name', 'label' => __('Last name', 'anspress-question-answer'), 'type' => 'text', 'placeholder' => __('Your surname', 'anspress-question-answer'), 'value' => $fields_value['last_name'], 'order' => 5, 'autocomplete' => false, 'sanitize' => array('strip_tags', 'sanitize_text_field')), array('name' => 'nickname', 'label' => __('Nickname', 'anspress-question-answer'), 'type' => 'text', 'placeholder' => __('Your nickname', 'anspress-question-answer'), 'value' => $fields_value['nickname'], 'order' => 5, 'autocomplete' => false, 'sanitize' => array('strip_tags', 'sanitize_text_field')), array('name' => 'display_name', 'label' => __('Display name', 'anspress-question-answer'), 'type' => 'select', 'options' => ap_user_get_display_name_option($user_id), 'value' => $fields_value['display_name'], 'order' => 5, 'autocomplete' => false, 'sanitize' => array('strip_tags', 'sanitize_text_field')), array('name' => 'description', 'label' => __('Description', 'anspress-question-answer'), 'type' => 'textarea', 'value' => $fields_value['description'], 'placeholder' => __('Write something about yourself', 'anspress-question-answer'), 'rows' => 5, 'order' => 5, 'sanitize' => array('strip_tags', 'sanitize_text_field')), array('name' => 'signature', 'label' => __('Signature', 'anspress-question-answer'), 'type' => 'textarea', 'value' => $fields_value['signature'], 'placeholder' => __('A short signature for showing in hover card', 'anspress-question-answer'), 'rows' => 5, 'order' => 5, 'sanitize' => array('strip_tags', 'sanitize_text_field')));
$form_fields['account'] = array(array('name' => 'user_login', 'label' => __('Username', 'anspress-question-answer'), 'type' => 'text', 'placeholder' => __('Your username', 'anspress-question-answer'), 'desc' => __('This cannot be changed.', 'anspress-question-answer'), 'value' => $fields_value['user_login'], 'order' => 5, 'attr' => 'disabled="disabled"', 'autocomplete' => false, 'sanitize' => array('sanitize_text_field'), 'visibility' => 'me'), array('name' => 'user_email', 'label' => __('Email', 'anspress-question-answer'), 'type' => 'text', 'placeholder' => __('Your contact email', 'anspress-question-answer'), 'desc' => __('NOTICE: If you update email then you need to re-verify your email and account.', 'anspress-question-answer'), 'value' => $fields_value['user_email'], 'order' => 5, 'autocomplete' => false, 'edit_disabled' => true, 'sanitize' => array('is_email'), 'validate' => array('is_email'), 'visibility' => 'me', 'show_desc_tip' => false), array('name' => 'password', 'label' => __('Password', 'anspress-question-answer'), 'type' => 'password', 'placeholder' => __('Update your password', 'anspress-question-answer'), 'value' => '', 'visibility' => 'me', 'order' => 5, 'autocomplete' => false));
$form_fields = apply_filters('ap_user_fields', $form_fields);
if (isset($form_fields[$group])) {
return $form_fields[$group];
}
return false;
}
示例2: ap_get_user_fields
function ap_get_user_fields($group = 'basic', $user_id = false)
{
if (!$user_id) {
$user_id = get_current_user_id();
}
$fields_value = ap_user_get_the_meta(false, $user_id);
$form_fields = array();
$form_fields['basic'] = array(array('name' => 'first_name', 'label' => __('First name', 'ap'), 'type' => 'text', 'placeholder' => __('Your first name', 'ap'), 'value' => $fields_value['first_name'], 'order' => 5, 'autocomplete' => false, 'sanitize' => array('strip_tags', 'sanitize_text_field')), array('name' => 'last_name', 'label' => __('Last name', 'ap'), 'type' => 'text', 'placeholder' => __('Your surname', 'ap'), 'value' => $fields_value['last_name'], 'order' => 5, 'autocomplete' => false, 'sanitize' => array('strip_tags', 'sanitize_text_field')), array('name' => 'nickname', 'label' => __('Nickname', 'ap'), 'type' => 'text', 'placeholder' => __('Your nickname', 'ap'), 'value' => $fields_value['nickname'], 'order' => 5, 'autocomplete' => false, 'sanitize' => array('strip_tags', 'sanitize_text_field')), array('name' => 'display_name', 'label' => __('Display name', 'ap'), 'type' => 'select', 'options' => ap_user_get_display_name_option($user_id), 'value' => $fields_value['display_name'], 'order' => 5, 'autocomplete' => false, 'sanitize' => array('strip_tags', 'sanitize_text_field')), array('name' => 'description', 'label' => __('Description', 'ap'), 'type' => 'textarea', 'value' => $fields_value['description'], 'placeholder' => __('Write something about yourself'), 'rows' => 5, 'order' => 5, 'sanitize' => array('strip_tags', 'sanitize_text_field')));
$form_fields['account'] = array(array('name' => 'user_login', 'label' => __('Username', 'ap'), 'type' => 'text', 'placeholder' => __('Your username', 'ap'), 'desc' => __('This cannot be changed.', 'ap'), 'value' => $fields_value['user_login'], 'order' => 5, 'attr' => 'disabled="disabled"', 'autocomplete' => false, 'sanitize' => array('sanitize_text_field'), 'visibility' => 'me'), array('name' => 'user_email', 'label' => __('Email', 'ap'), 'type' => 'text', 'placeholder' => __('Your contact email', 'ap'), 'value' => $fields_value['user_email'], 'order' => 5, 'autocomplete' => false, 'edit_disabled' => true, 'sanitize' => array('is_email'), 'validate' => array('is_email'), 'visibility' => 'me'), array('name' => 'password', 'label' => __('Password', 'ap'), 'type' => 'password', 'placeholder' => __('Update your password', 'ap'), 'value' => 'password', 'visibility' => 'me', 'order' => 5, 'autocomplete' => false));
$form_fields = apply_filters('ap_user_fields', $form_fields);
if (isset($form_fields[$group])) {
return $form_fields[$group];
}
return false;
}
示例3: ap_user_votes_casted_percent
function ap_user_votes_casted_percent()
{
$meta = (int) ap_user_get_the_meta('__up_vote_casted');
$total_vote = (int) ap_user_total_votes_casted();
if ($total_vote == 0 || $meta == 0) {
return 0;
} else {
return ceil($meta / $total_vote * 100);
}
}
示例4: printf
?>
</span>
<span><?php
printf(__('%d Answers', 'ap'), ap_user_get_the_meta('__total_answers'));
?>
</span>
<span><?php
printf(__('%d Questions', 'ap'), ap_user_get_the_meta('__total_questions'));
?>
</span>
<span><?php
printf(__('%d Followers', 'ap'), ap_user_get_the_meta('__total_followers'));
?>
</span>
<span><?php
printf(__('%d Following', 'ap'), ap_user_get_the_meta('__total_following'));
?>
</span>
</div>
<?php
if (ap_user_meta_exists('description')) {
?>
<div class="ap-user-dscription">
<div class="ap-user-description-in">
<div id="user-summery">
<?php
ap_user_the_meta('description');
?>
</div>
示例5: ap_icon
</div>
</li>
<li>
<div class="ap-about-stats-item">
<?php
echo ap_icon('eye', true);
printf(__('%d profile views', 'ap'), ap_user_get_the_meta('__profile_views'));
?>
</div>
</li>
<li>
<div class="ap-about-stats-item">
<?php
echo ap_icon('clock', true);
if (ap_user_get_the_meta('__last_active') != 0) {
printf(__('Last seen %s ago', 'ap'), ap_human_time(ap_user_get_the_meta('__last_active'), false));
} else {
_e('Never logged in', 'ap');
}
?>
</div>
</li>
</ul><!-- close .ap-about-stats -->
</div><!-- close .ap-about-block-c -->
</div><!-- close .ap-about-block.user-stats -->
<div class="ap-about-block">
<h3><?php
echo ap_icon('reputation', true);
示例6: ap_icon
</div>
</li>
<li>
<div class="ap-about-stats-item">
<?php
echo ap_icon('eye', true);
printf(__('%d profile views', 'anspress-question-answer'), ap_user_get_the_meta('__profile_views'));
?>
</div>
</li>
<li>
<div class="ap-about-stats-item">
<?php
echo ap_icon('clock', true);
if (ap_user_get_the_meta('__last_active') != 0) {
printf(__('Last seen %s', 'anspress-question-answer'), ap_human_time(ap_user_get_the_meta('__last_active'), false));
} else {
_e('Never logged in', 'anspress-question-answer');
}
?>
</div>
</li>
</ul><!-- close .ap-about-stats -->
</div><!-- close .ap-about-block-c -->
</div><!-- close .ap-about-block.user-stats -->
<?php
do_action('ap_user_about_block_after_status');
?>
示例7: ap_user_the_reputation
?>
</a>
<div class="ap-card-reputation"><span><?php
ap_user_the_reputation();
?>
</span><?php
_e('Reputation', 'anspress-question-answer');
?>
</div>
<div class="ap-card-stats">
<span><?php
echo ap_icon('answer', true);
printf(__('%d answers, %d selected', 'anspress-question-answer'), ap_user_get_the_meta('__total_answers'), ap_user_get_the_meta('__best_answers'));
?>
</span>
<span><?php
echo ap_icon('question', true);
printf(__('%d questions, %d solved', 'anspress-question-answer'), ap_user_get_the_meta('__total_questions'), ap_user_get_the_meta('__solved_answers'));
?>
</span>
<span><i class="apicon-comment-discussion"></i> <?php
printf(__('%d Followers, %d following', 'anspress-question-answer'), ap_user_get_the_meta('__total_followers'), ap_user_get_the_meta('__total_following'));
?>
</span>
</div>
<?php
do_action('ap_hover_card_after_status', ap_user_get_the_ID());
?>
</div>
</div>
</div>
示例8: printf
</a>
<div class="ap-users-mini-status">
<span><?php
printf(__('%s Rep.', 'ap'), ap_user_get_the_reputation());
?>
</span>
<span><?php
printf(__('%d Best', 'ap'), ap_user_get_the_meta('__best_answers'));
?>
</span>
<span><?php
printf(__('%d Answers', 'ap'), ap_user_get_the_meta('__total_answers'));
?>
</span>
<span><?php
printf(__('%d Questions', 'ap'), ap_user_get_the_meta('__total_questions'));
?>
</span>
<?php
/**
* ACTION: ap_users_loop_meta
* Used to hook into loop item meta
* @since 2.1.0
*/
do_action('ap_users_loop_meta');
?>
</div>
<div class="ap-users-buttons clearfix">
<?php
ap_follow_button(ap_user_get_the_ID());
?>
示例9: ap_icon
<div class="ap-card-stats">
<span>
<?php
echo ap_icon('answer', true);
?>
<?php
printf(__('%s answers, %s selected', 'anspress-question-answer'), '<b>' . ap_user_get_the_meta('__total_answers') . '</b>', '<b>' . ap_user_get_the_meta('__best_answers') . '</b>');
?>
</span>
<span>
<?php
echo ap_icon('question', true);
?>
<?php
printf(__('%s questions, %s solved', 'anspress-question-answer'), '<b>' . ap_user_get_the_meta('__total_questions') . '</b>', '<b>' . ap_user_get_the_meta('__solved_answers') . '</b>');
?>
</span>
<span>
<i class="apicon-users"></i>
<?php
printf(__('%s Followers, %s following', 'anspress-question-answer'), '<b>' . ap_user_get_the_meta('__total_followers') . '</b>', '<b>' . ap_user_get_the_meta('__total_following') . '</b>');
?>
</span>
</div>
<?php
do_action('ap_hover_card_after_status', ap_user_get_the_ID());
?>
</div>
</div>
示例10: ap_user_get_display_name_option
/**
* Return array of user name, to be used in display name user field
* @param integer $user_id
* @return array
* @since 2.1
*/
function ap_user_get_display_name_option($user_id = false)
{
$user_id = ap_parameter_empty(@$user_id, @ap_user_get_the_ID());
$user = ap_user_get_the_meta(false, $user_id);
$public_display = array();
if (!empty($user['nickname'])) {
$public_display[$user['nickname']] = $user['nickname'];
}
if (!empty($user['user_login'])) {
$public_display[$user['user_login']] = $user['user_login'];
}
if (!empty($user['first_name'])) {
$public_display[$user['first_name']] = $user['first_name'];
}
if (!empty($user['last_name'])) {
$public_display[$user['last_name']] = $user['last_name'];
}
if (!empty($user['first_name']) && !empty($user['last_name'])) {
$public_display[$user['first_name'] . ' ' . $user['last_name']] = $user['first_name'] . ' ' . $user['last_name'];
$public_display[$user['last_name'] . ' ' . $user['first_name']] = $user['last_name'] . ' ' . $user['first_name'];
}
return $public_display;
}