mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-20 07:04:06 +09:00
- fix edit user link
This commit is contained in:
@@ -19,6 +19,7 @@ if ( ! class_exists( 'um\frontend\User_Profile' ) ) {
|
|||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
add_action( 'template_redirect', array( $this, 'handle_edit_screen' ), 10000 );
|
add_action( 'template_redirect', array( $this, 'handle_edit_screen' ), 10000 );
|
||||||
|
add_filter( 'get_edit_user_link', array( $this, 'get_um_edit_user_link' ), 10, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,6 +31,7 @@ if ( ! class_exists( 'um\frontend\User_Profile' ) ) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable WordPress.Security.NonceVerification
|
||||||
if ( ! isset( $_REQUEST['um_action'] ) ) {
|
if ( ! isset( $_REQUEST['um_action'] ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -44,6 +46,7 @@ if ( ! class_exists( 'um\frontend\User_Profile' ) ) {
|
|||||||
if ( isset( $_REQUEST['uid'] ) ) {
|
if ( isset( $_REQUEST['uid'] ) ) {
|
||||||
$uid = absint( $_REQUEST['uid'] );
|
$uid = absint( $_REQUEST['uid'] );
|
||||||
}
|
}
|
||||||
|
// phpcs:enable WordPress.Security.NonceVerification
|
||||||
|
|
||||||
if ( ! empty( $uid ) && ! UM()->common()->users()::user_exists( $uid ) ) {
|
if ( ! empty( $uid ) && ! UM()->common()->users()::user_exists( $uid ) ) {
|
||||||
return;
|
return;
|
||||||
@@ -65,5 +68,9 @@ if ( ! class_exists( 'um\frontend\User_Profile' ) ) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get_um_edit_user_link( $link, $user_id ) {
|
||||||
|
return um_edit_profile_url( $user_id );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user