if (empty($xt_user_follow)) { $xt_user_follow = get_user_meta($_user->ID, XT_USER_FOLLOW, true); } if (empty($xt_user_follow)) { $xt_user_follow = array($_user->ID); } } if (isset($_POST['userId']) && absint($_POST['userId'])) { $xt_user = new WP_User(absint($_POST['userId'])); if ($xt_user->exists()) { $xt_user_counts = xt_default_counts(); $_xt_user_counts = get_user_meta($xt_user->ID, XT_USER_COUNT, true); if (!empty($_xt_user_counts)) { $xt_user_counts = array_merge($xt_user_counts, $_xt_user_counts); } $url = xt_get_the_user_url(); ?> <div class="clearfix"> <div class="clearfix"> <a href="<?php echo $url; ?> " class="xt-avatar pull-left" target="_blank"> <img src="<?php xt_the_user_pic(); ?> " alt="<?php xt_the_user_title(); ?> "> </a>
function _xt_sitemap_build_user($type = '') { global $wpdb; $users = $wpdb->get_results('SELECT ID,user_registered FROM ' . $wpdb->users . ' ORDER BY id DESC LIMIT ' . XT_SITEMAP_USER_LIMIT); if ($type == 'baidu') { } else { $xml_begin = '<?xml version="1.0" encoding="utf-8"?><urlset>'; $xml_indexs = ''; if (!empty($users)) { foreach ($users as $user) { $xml_indexs .= '<url>'; $xml_indexs .= '<loc>' . xt_get_the_user_url($user->ID) . '</loc>'; $xml_indexs .= '<lastmod>' . date('Y-m-d', strtotime($user->user_registered)) . '</lastmod>'; $xml_indexs .= '<changefreq>' . XT_SITEMAP_USER_CHANGEFREQ . '</changefreq>'; $xml_indexs .= '<priority>' . XT_SITEMAP_USER_PRIORITY . '</priority>'; $xml_indexs .= '</url>'; } } $xml_end = '</urlset>'; return $xml_begin . $xml_indexs . $xml_end; } }
function xt_login_redirect($redirect_to, $request, $user) { if (!empty($user) && isset($user->roles) && is_array($user->roles)) { // if (in_array("administrator", $user->roles)) { // return home_url("/wp-admin/"); // } else { return xt_get_the_user_url($user->ID); // } } }
function xt_the_user_url($user_id = 0) { echo xt_get_the_user_url($user_id); }