本文整理汇总了PHP中um_get_core_page函数的典型用法代码示例。如果您正苦于以下问题:PHP um_get_core_page函数的具体用法?PHP um_get_core_page怎么用?PHP um_get_core_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了um_get_core_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: um_block_wpadmin_for_guests
function um_block_wpadmin_for_guests()
{
global $pagenow;
if (isset($_REQUEST['um_panic_key']) && $_REQUEST['um_panic_key'] == um_get_option('panic_key')) {
exit(wp_redirect(add_query_arg('_verified_key', $_REQUEST['um_panic_key'], wp_login_url())));
}
if (!isset($_REQUEST['_verified_key']) || $_REQUEST['_verified_key'] != um_get_option('panic_key')) {
// Logout screen
if (isset($pagenow) && $pagenow == 'wp-login.php' && is_user_logged_in() && isset($_REQUEST['action']) && $_REQUEST['action'] == 'logout') {
$redirect = um_get_core_page('logout');
if (isset($_REQUEST['redirect_to']) && !empty($_REQUEST['redirect_to'])) {
$redirect = add_query_arg('redirect_to', $_REQUEST['redirect_to'], $redirect);
}
exit(wp_redirect($redirect));
}
// Login screen
if (isset($pagenow) && $pagenow == 'wp-login.php' && !is_user_logged_in() && !isset($_REQUEST['action'])) {
$allowed = um_get_option('wpadmin_login');
$allowed = apply_filters('um_whitelisted_wpadmin_access', $allowed);
if (!$allowed) {
$act = um_get_option('wpadmin_login_redirect');
$custom_url = um_get_option('wpadmin_login_redirect_url');
if ($act == 'um_login_page' || !$custom_url) {
$redirect = um_get_core_page('login');
} else {
$redirect = $custom_url;
}
exit(wp_redirect($redirect));
}
}
// Register screen
if (isset($pagenow) && $pagenow == 'wp-login.php' && !is_user_logged_in() && isset($_REQUEST['action']) && $_REQUEST['action'] == 'register') {
$allowed = um_get_option('wpadmin_register');
$allowed = apply_filters('um_whitelisted_wpadmin_access', $allowed);
if (!$allowed) {
$act = um_get_option('wpadmin_register_redirect');
$custom_url = um_get_option('wpadmin_register_redirect_url');
if ($act == 'um_register_page' || !$custom_url) {
$redirect = um_get_core_page('register');
} else {
$redirect = $custom_url;
}
exit(wp_redirect($redirect));
}
}
// Lost password page
if (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_REQUEST['action']) && $_REQUEST['action'] == 'lostpassword') {
exit(wp_redirect(um_get_core_page('password-reset')));
}
// Prevention for logged in user
if (isset($pagenow) && $pagenow == 'wp-login.php' && is_user_logged_in() && isset($_REQUEST['action']) && $_REQUEST['action'] != 'postpass') {
if (!um_user('can_access_wpadmin')) {
exit(wp_redirect(home_url()));
} else {
exit(wp_redirect(admin_url()));
}
}
}
}
示例2: tab_link
function tab_link($id)
{
if (get_option('permalink_structure')) {
$url = trailingslashit(untrailingslashit(um_get_core_page('account')));
$url = $url . $id . '/';
} else {
$url = add_query_arg('um_tab', $id, um_get_core_page('account'));
}
return $url;
}
示例3: reset_url
function reset_url()
{
global $ultimatemember;
if (!um_user('reset_pass_hash')) {
return false;
}
$url = add_query_arg('act', 'reset_password', um_get_core_page('password-reset'));
$url = add_query_arg('hash', esc_attr(um_user('reset_pass_hash')), $url);
$url = add_query_arg('user_id', esc_attr(um_user('ID')), $url);
return $url;
}
示例4: um_change_password_process_hook
function um_change_password_process_hook($args)
{
global $ultimatemember;
wp_set_password($args['user_password'], $args['user_id']);
delete_user_meta($args['user_id'], 'reset_pass_hash');
delete_user_meta($args['user_id'], 'reset_pass_hash_token');
do_action('um_after_changing_user_password', $args['user_id']);
if (is_user_logged_in()) {
wp_logout();
}
exit(wp_redirect(um_get_core_page('login', 'password_changed')));
}
示例5: um_convert_tags
function um_convert_tags($content, $args = array())
{
$search = array('{display_name}', '{first_name}', '{last_name}', '{gender}', '{username}', '{email}', '{password}', '{login_url}', '{site_name}', '{site_url}', '{account_activation_link}', '{password_reset_link}', '{admin_email}', '{user_profile_link}', '{user_account_link}', '{submitted_registration}', '{user_avatar_url}');
$search = apply_filters('um_template_tags_patterns_hook', $search);
$replace = array(um_user('display_name'), um_user('first_name'), um_user('last_name'), um_user('gender'), um_user('user_login'), um_user('user_email'), um_user('_um_cool_but_hard_to_guess_plain_pw'), um_get_core_page('login'), um_get_option('site_name'), get_bloginfo('url'), um_user('account_activation_link'), um_user('password_reset_link'), um_admin_email(), um_user_profile_url(), um_get_core_page('account'), um_user_submitted_registration(), um_get_user_avatar_url());
$replace = apply_filters('um_template_tags_replaces_hook', $replace);
$content = str_replace($search, $replace, $content);
if (isset($args['tags']) && isset($args['tags_replace'])) {
$content = str_replace($args['tags'], $args['tags_replace'], $content);
}
return $content;
}
示例6: template_redirect
function template_redirect()
{
global $ultimatemember;
do_action('um_access_homepage_per_role');
do_action('um_access_global_settings');
do_action('um_access_post_settings');
if ($this->redirect_handler && !$this->allow_access) {
// login page add protected page automatically
if (strstr($this->redirect_handler, um_get_core_page('login'))) {
$curr = $ultimatemember->permalinks->get_current_url();
$this->redirect_handler = esc_url(add_query_arg('redirect_to', $curr, $this->redirect_handler));
}
exit(wp_redirect($this->redirect_handler));
}
}
示例7: template_redirect
function template_redirect()
{
global $post, $ultimatemember;
do_action('um_access_global_settings');
do_action('um_access_frontpage_per_role');
do_action('um_access_homepage_per_role');
do_action('um_access_category_settings');
do_action('um_access_post_settings');
if ($this->redirect_handler && $this->allow_access == false && !um_is_core_page('login')) {
// login page add protected page automatically
if (strstr($this->redirect_handler, um_get_core_page('login'))) {
$curr = $ultimatemember->permalinks->get_current_url();
$this->redirect_handler = esc_url(add_query_arg('redirect_to', urlencode_deep($curr), $this->redirect_handler));
}
wp_redirect($this->redirect_handler);
}
}
示例8: locate_user_profile
function locate_user_profile()
{
global $post, $ultimatemember;
if (um_queried_user() && um_is_core_page('user')) {
if (um_get_option('permalink_base') == 'user_login') {
$user_id = username_exists(um_queried_user());
// Try nice name
if (!$user_id) {
$slug = um_queried_user();
$slug = str_replace('.', '-', $slug);
$the_user = get_user_by('slug', $slug);
if (isset($the_user->ID)) {
$user_id = $the_user->ID;
}
}
}
if (um_get_option('permalink_base') == 'user_id') {
$user_id = $ultimatemember->user->user_exists_by_id(um_queried_user());
}
if (um_get_option('permalink_base') == 'name') {
$user_id = $ultimatemember->user->user_exists_by_name(um_queried_user());
}
/** USER EXISTS SET USER AND CONTINUE **/
if ($user_id) {
um_set_requested_user($user_id);
} else {
exit(wp_redirect(um_get_core_page('user')));
}
} else {
if (um_is_core_page('user')) {
// just base64_decode
if (is_user_logged_in()) {
// just redirect to their profile
$query = $ultimatemember->permalinks->get_query_array();
$url = um_user_profile_url();
if ($query) {
foreach ($query as $key => $val) {
$url = add_query_arg($key, $val, $url);
}
}
exit(wp_redirect($url));
}
}
}
}
示例9: activate_account_via_email_link
function activate_account_via_email_link()
{
global $ultimatemember;
if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'activate_via_email' && isset($_REQUEST['hash']) && strlen($_REQUEST['hash']) == 40 && isset($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id'])) {
// valid token
um_fetch_user($_REQUEST['user_id']);
if (um_user('account_status') != 'awaiting_email_confirmation') {
wp_die('The activation link you used is invalid or has expired.');
}
if ($_REQUEST['hash'] != um_user('account_secret_hash')) {
wp_die('The secret key provided does not match this one for the user.');
}
$ultimatemember->user->approve();
$redirect = um_user('url_email_activate') ? um_user('url_email_activate') : um_get_core_page('login', 'account_active');
um_reset_user();
exit(wp_redirect($redirect));
}
}
示例10: um_convert_tags
function um_convert_tags($content, $args = array())
{
$search = array('{display_name}', '{first_name}', '{last_name}', '{gender}', '{username}', '{email}', '{password}', '{login_url}', '{login_referrer}', '{site_name}', '{site_url}', '{account_activation_link}', '{password_reset_link}', '{admin_email}', '{user_profile_link}', '{user_account_link}', '{submitted_registration}', '{user_avatar_url}');
$search = apply_filters('um_template_tags_patterns_hook', $search);
$replace = array(um_user('display_name'), um_user('first_name'), um_user('last_name'), um_user('gender'), um_user('user_login'), um_user('user_email'), um_user('_um_cool_but_hard_to_guess_plain_pw'), um_get_core_page('login'), um_dynamic_login_page_redirect(), um_get_option('site_name'), get_bloginfo('url'), um_user('account_activation_link'), um_user('password_reset_link'), um_admin_email(), um_user_profile_url(), um_get_core_page('account'), um_user_submitted_registration(), um_get_user_avatar_url());
$replace = apply_filters('um_template_tags_replaces_hook', $replace);
$content = str_replace($search, $replace, $content);
if (isset($args['tags']) && isset($args['tags_replace'])) {
$content = str_replace($args['tags'], $args['tags_replace'], $content);
}
$regex = '~\\{([^}]*)\\}~';
preg_match_all($regex, $content, $matches);
// Support for all usermeta keys
if (isset($matches[1]) && is_array($matches[1]) && !empty($matches[1])) {
foreach ($matches[1] as $match) {
$strip_key = str_replace('usermeta:', '', $match);
$content = str_replace('{' . $match . '}', um_user($strip_key), $content);
}
}
return $content;
}
示例11: um_logout_user_links
function um_logout_user_links($args)
{
global $ultimatemember;
?>
<li><a href="<?php
echo um_get_core_page('account');
?>
"><?php
_e('Your account', 'ultimatemember');
?>
</a></li>
<li><a href="<?php
echo esc_url(add_query_arg('redirect_to', $ultimatemember->permalinks->get_current_url(true), um_get_core_page('logout')));
?>
"><?php
_e('Logout', 'ultimatemember');
?>
</a></li>
<?php
}
示例12: um_access_post_settings
function um_access_post_settings()
{
global $post, $ultimatemember;
// woo commerce shop ID
if (function_exists('is_shop') && is_shop()) {
$um_post_id = get_option('woocommerce_shop_page_id');
} else {
if (is_category() || is_archive() || is_search() || in_the_loop() || is_feed() || is_tax() || !get_post_type() || !isset($post->ID) || is_home() || is_front_page()) {
return;
}
}
if (!isset($um_post_id)) {
$um_post_id = $post->ID;
}
$args = $ultimatemember->access->get_meta($um_post_id);
extract($args);
$categories = get_the_category($post->ID);
// Check post category restriction
foreach ($categories as $cat) {
$opt = get_option("category_{$cat->term_id}");
if (isset($opt['_um_accessible'])) {
switch ($opt['_um_accessible']) {
case 0:
// Open to everyone
$ultimatemember->access->allow_access = true;
$ultimatemember->access->redirect_handler = false;
// open to everyone
break;
case 1:
// Logged out users only
if (is_user_logged_in()) {
$ultimatemember->access->redirect_handler = isset($opt['_um_redirect']) ? $opt['_um_redirect'] : site_url();
}
if (!is_user_logged_in()) {
$ultimatemember->access->allow_access = true;
}
break;
case 2:
// Logged in users only
if (!is_user_logged_in()) {
$ultimatemember->access->redirect_handler = isset($opt['_um_redirect']) && !empty($opt['_um_redirect']) ? $opt['_um_redirect'] : um_get_core_page('login');
$ultimatemember->access->allow_access = false;
}
if (is_user_logged_in()) {
if (isset($opt['_um_roles']) && !empty($opt['_um_roles'])) {
if (in_array(um_user('role'), $opt['_um_roles'])) {
$ultimatemember->access->allow_access = true;
} else {
$ultimatemember->access->redirect_handler = isset($opt['_um_redirect']) && !empty($opt['_um_redirect']) ? $opt['_um_redirect'] : site_url();
$ultimatemember->access->allow_access = false;
}
} else {
// if allowed all roles
$ultimatemember->access->allow_access = true;
}
}
}
}
// end if isset( $opt['_um_accessible'] )
// if one of the categories has enabled restriction, apply its settings to the current post
if ($ultimatemember->access->allow_access == false) {
return;
}
}
// end foreach
if (!isset($args['custom_access_settings']) || $args['custom_access_settings'] == 0) {
$um_post_id = apply_filters('um_access_control_for_parent_posts', $um_post_id);
$args = $ultimatemember->access->get_meta($um_post_id);
extract($args);
if (!isset($args['custom_access_settings']) || $args['custom_access_settings'] == 0) {
return;
}
}
$redirect_to = null;
if (!isset($accessible)) {
return;
}
switch ($accessible) {
case 0:
$ultimatemember->access->allow_access = true;
$ultimatemember->access->redirect_handler = false;
// open to everyone
break;
case 1:
$redirect_to = esc_url($access_redirect2);
if (is_user_logged_in()) {
$ultimatemember->access->allow_access = false;
}
if (!is_user_logged_in()) {
$ultimatemember->access->allow_access = true;
}
if (!empty($redirect_to)) {
$ultimatemember->access->redirect_handler = esc_url($redirect_to);
} else {
if (!is_user_logged_in()) {
$ultimatemember->access->redirect_handler = um_get_core_page("login");
} else {
$ultimatemember->access->redirect_handler = um_get_core_page("user");
}
}
//.........这里部分代码省略.........
示例13: um_get_core_page
?>
" target="_blank">User</a></li>
<li><a href="<?php
echo um_get_core_page('members');
?>
" target="_blank">Members</a></li>
<li><a href="<?php
echo um_get_core_page('account');
?>
" target="_blank">Account</a></li>
<li><a href="<?php
echo admin_url('post.php?post=' . $ultimatemember->permalinks->core['logout'] . '&action=edit');
?>
" target="_blank">Logout</a></li>
<li><a href="<?php
echo um_get_core_page('password-reset');
?>
" target="_blank">Password Reset</a></li>
</ul>
</p>
</div>
<div class="last-feature">
<h4>Getting started</h4>
<p>The plugin has several different elements in the WordPress admin that allow you to customize your community/membership site:</p>
<p>
<ul>
<li><a href="<?php
echo admin_url('admin.php?page=ultimatemember');
?>
" target="_blank">Dashboard</a></li>
示例14: esc_url
<form role="search" method="get" class="search-form um-search-form" action="<?php
echo esc_url(um_get_core_page('members'));
?>
">
<input type="hidden" name="um_search" value="1">
<div class="um-search-area">
<span class="screen-reader-text"><?php
echo _x('Search for:', 'label');
?>
</span>
<input type="search" class="um-search-field search-field" placeholder="<?php
echo esc_attr_x('Search …', 'placeholder');
?>
" value="<?php
echo um_get_search_query();
?>
" name="search" title="<?php
echo esc_attr_x('Search for:', 'label');
?>
" />
<a href="javascript: void(0);" id="um-search-button" class="um-search-icon um-faicon um-faicon-search"></a>
</div>
</form>
示例15: um_after_login_submit
function um_after_login_submit($args)
{
global $ultimatemember;
if ($args['forgot_pass_link'] == 0) {
return;
}
?>
<div class="um-col-alt-b">
<a href="<?php
echo um_get_core_page('password-reset');
?>
" class="um-link-alt"><?php
_e('Forgot your password?', 'ultimatemember');
?>
</a>
</div>
<?php
}