本文整理汇总了PHP中um_get_requested_user函数的典型用法代码示例。如果您正苦于以下问题:PHP um_get_requested_user函数的具体用法?PHP um_get_requested_user怎么用?PHP um_get_requested_user使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了um_get_requested_user函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: um_dynamic_user_profile_title
function um_dynamic_user_profile_title($title, $id = '')
{
global $ultimatemember;
if (is_admin()) {
return $title;
}
if ($id == $ultimatemember->permalinks->core['user']) {
if (um_is_core_page('user') && um_get_requested_user()) {
$title = um_get_display_name(um_get_requested_user());
} else {
if (um_is_core_page('user') && is_user_logged_in()) {
$title = um_get_display_name(get_current_user_id());
}
}
}
return strlen($title) !== strlen(utf8_decode($title)) ? $title : utf8_encode($title);
}
开发者ID:Makenrro,项目名称:repos,代码行数:17,代码来源:um-filters-profile.php
示例2: title_from_special_fields
/**
* Fetches title from special fields, like other plugins with special queries.
* Used before and has priority over custom fields.
* Front end only.
*
* @since 2.5.2
*
* @return string $title Title from Special Field.
*/
public function title_from_special_fields()
{
$title = '';
if (false === $this->is_admin()) {
if ($this->is_ultimate_member_user_page() && um_is_core_page('user') && um_get_requested_user()) {
$title = um_user('display_name');
}
}
return $title;
}
开发者ID:sybrew,项目名称:the-seo-framework,代码行数:19,代码来源:generate-title.class.php
示例3: um_is_myprofile
function um_is_myprofile()
{
global $ultimatemember;
if (get_current_user_id() && get_current_user_id() == um_get_requested_user()) {
return true;
}
if (!um_get_requested_user() && um_is_core_page('user') && get_current_user_id()) {
return true;
}
return false;
}
开发者ID:lytranuit,项目名称:wordpress,代码行数:11,代码来源:um-short-functions.php
示例4: load
function load($args)
{
global $ultimatemember;
ob_start();
$defaults = array();
$args = wp_parse_args($args, $defaults);
// when to not continue
$this->form_id = isset($args['form_id']) ? $args['form_id'] : null;
if (!$this->form_id) {
return;
}
$this->form_status = get_post_status($this->form_id);
if ($this->form_status != 'publish') {
return;
}
// get data into one global array
$post_data = $ultimatemember->query->post_data($this->form_id);
$args = apply_filters('um_pre_args_setup', $post_data);
if (!isset($args['template'])) {
$args['template'] = '';
}
if (isset($post_data['template']) && $post_data['template'] != $args['template']) {
$args['template'] = $post_data['template'];
}
if (!$this->template_exists($args['template'])) {
$args['template'] = $post_data['mode'];
}
if (!isset($post_data['template'])) {
$post_data['template'] = $post_data['mode'];
}
$args = array_merge($post_data, $args);
if (isset($args['use_globals']) && $args['use_globals'] == 1) {
$args = array_merge($args, $this->get_css_args($args));
} else {
$args = array_merge($this->get_css_args($args), $args);
}
// filter for arguments
$args = apply_filters('um_shortcode_args_filter', $args);
extract($args, EXTR_SKIP);
// for profiles only
if ($mode == 'profile' && um_profile_id() && isset($args['role']) && $args['role'] && $args['role'] != $ultimatemember->query->get_role_by_userid(um_profile_id())) {
return;
}
// start loading the template here
do_action("um_pre_{$mode}_shortcode", $args);
do_action("um_before_form_is_loaded", $args);
do_action("um_before_{$mode}_form_is_loaded", $args);
$this->template_load($template, $args);
$this->dynamic_css($args);
if (um_get_requested_user() || $mode == 'logout') {
um_reset_user();
}
do_action('um_after_everything_output');
$output = ob_get_contents();
ob_end_clean();
return $output;
}
开发者ID:dracudakid,项目名称:WP_TrungTamTinHoc,代码行数:57,代码来源:um-shortcodes.php
示例5: um_pre_profile_shortcode
function um_pre_profile_shortcode($args)
{
global $ultimatemember;
extract($args);
if ($mode == 'profile' && $ultimatemember->fields->editing == false) {
$ultimatemember->fields->viewing = 1;
if (um_get_requested_user()) {
if (!um_can_view_profile(um_get_requested_user())) {
um_redirect_home();
}
if (!um_current_user_can('edit', um_get_requested_user())) {
$ultimatemember->user->cannot_edit = 1;
}
um_fetch_user(um_get_requested_user());
} else {
if (!is_user_logged_in()) {
um_redirect_home();
}
if (!um_user('can_edit_profile')) {
$ultimatemember->user->cannot_edit = 1;
}
}
}
if ($mode == 'profile' && $ultimatemember->fields->editing == true) {
$ultimatemember->fields->editing = 1;
if (um_get_requested_user()) {
if (!um_current_user_can('edit', um_get_requested_user())) {
um_redirect_home();
}
um_fetch_user(um_get_requested_user());
}
}
}
开发者ID:TeamSubjectMatter,项目名称:juddfoundation,代码行数:33,代码来源:um-actions-profile.php
注:本文中的um_get_requested_user函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论