From 0e0977f37bf8f1dda97cf6ce26065bd90232e8a9 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Thu, 28 Nov 2024 17:49:48 +0200 Subject: [PATCH] * fixed #1595; --- includes/core/um-actions-profile.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/includes/core/um-actions-profile.php b/includes/core/um-actions-profile.php index bb3eb6c8..33819c07 100644 --- a/includes/core/um-actions-profile.php +++ b/includes/core/um-actions-profile.php @@ -739,7 +739,6 @@ function um_profile_dynamic_meta_desc() { '@context' => 'https://schema.org', '@type' => 'ProfilePage', 'dateCreated' => um_user( 'user_registered' ), - 'dateModified' => gmdate( 'Y-m-d H:i:s', um_user( 'last_update' ) ), 'mainEntity' => array( '@type' => 'Person', 'name' => esc_attr( $title ), @@ -751,6 +750,18 @@ function um_profile_dynamic_meta_desc() { ), ), ); + $user_last_update = um_user( 'last_update' ); + if ( ! empty( $user_last_update ) ) { + if ( is_numeric( $user_last_update ) ) { + $user_last_update = (int) $user_last_update; // cast numeric type to int + } else { + $user_last_update = strtotime( $user_last_update ); // cast string date type to int + } + if ( ! empty( $user_last_update ) ) { + $person['dateModified'] = gmdate( 'Y-m-d H:i:s', $user_last_update ); + } + } + /** * Filters changing the schema.org of profile's person. *