Merge pull request #1291 from ultimatemember/fix/rest_request_pages

REST API endpoint List Pages redirecting to the homepage
This commit is contained in:
Mykyta Synelnikov
2023-09-04 23:34:07 +03:00
committed by GitHub
+5
View File
@@ -1374,6 +1374,11 @@ function um_pre_profile_shortcode( $args ) {
return;
}
// disable for the REST API requests.
if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
return;
}
if ( true === UM()->fields()->editing ) {
if ( um_get_requested_user() ) {
if ( ! UM()->roles()->um_current_user_can( 'edit', um_get_requested_user() ) ) {