mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- fixed user permalinks for profile page;
This commit is contained in:
@@ -118,7 +118,8 @@ if ( ! class_exists( 'Admin_Users' ) ) {
|
||||
function user_row_actions( $actions, $user_object ) {
|
||||
$user_id = $user_object->ID;
|
||||
|
||||
$actions['frontend_profile'] = "<a class='' href='" . UM()->user()->get_profile_link( $user_id ) . "'>" . __( 'View profile', 'ultimate-member' ) . "</a>";
|
||||
|
||||
$actions['frontend_profile'] = "<a class='' href='" . um_user_profile_url( $user_id ) . "'>" . __( 'View profile', 'ultimate-member' ) . "</a>";
|
||||
|
||||
$submitted = get_user_meta( $user_id, 'submitted', true );
|
||||
if ( ! empty( $submitted ) )
|
||||
|
||||
@@ -229,12 +229,12 @@ if ( ! class_exists( 'Rewrite' ) ) {
|
||||
|
||||
$query = UM()->permalinks()->get_query_array();
|
||||
|
||||
$url = um_user_profile_url();
|
||||
if ( empty( $url ) ) {
|
||||
$url = um_user_profile_url( um_user( 'ID' ) );
|
||||
/*if ( empty( $url ) ) {
|
||||
//if empty profile slug - generate it and re-get profile URL
|
||||
UM()->user()->generate_profile_slug( um_user( 'ID' ) );
|
||||
$url = um_user_profile_url();
|
||||
}
|
||||
}*/
|
||||
|
||||
if ( $query ) {
|
||||
foreach ( $query as $key => $val ) {
|
||||
|
||||
@@ -456,7 +456,8 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
do_action( 'um_update_profile_full_name', um_user( 'ID' ), $to_update );
|
||||
|
||||
if ( ! isset( $args['is_signup'] ) ) {
|
||||
$url = UM()->user()->get_profile_link( um_user( 'ID' ) );
|
||||
|
||||
$url = um_user_profile_url( um_user( 'ID' ) );
|
||||
exit( wp_redirect( um_edit_my_profile_cancel_uri( $url ) ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -1399,10 +1399,23 @@ function um_admin_email() {
|
||||
/**
|
||||
* Display a link to profile page
|
||||
*
|
||||
* @return string
|
||||
* @param int|bool $user_id
|
||||
*
|
||||
* @return bool|string
|
||||
*/
|
||||
function um_user_profile_url() {
|
||||
return UM()->user()->get_profile_link( um_user( 'ID' ) );
|
||||
function um_user_profile_url( $user_id = false ) {
|
||||
if ( ! $user_id ) {
|
||||
$user_id = um_user( 'ID' );
|
||||
}
|
||||
|
||||
$url = UM()->user()->get_profile_link( $user_id );
|
||||
if ( empty( $url ) ) {
|
||||
//if empty profile slug - generate it and re-get profile URL
|
||||
UM()->user()->generate_profile_slug( $user_id );
|
||||
$url = UM()->user()->get_profile_link( $user_id );
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user