WPSEO_Admin_User_Profile{}
Customizes user profile.
Хуков нет.
Использование
$WPSEO_Admin_User_Profile = new WPSEO_Admin_User_Profile(); // use class methods
Методы
Код WPSEO_Admin_User_Profile{} WPSEO Admin User Profile{} Yoast 28.9
class WPSEO_Admin_User_Profile {
/**
* Class constructor.
*/
public function __construct() {
add_action( 'update_user_meta', [ $this, 'clear_author_sitemap_cache' ], 10, 3 );
}
/**
* Clear author sitemap cache when settings are changed.
*
* @since 3.1
*
* @param int $meta_id The ID of the meta option changed.
* @param int $object_id The ID of the user.
* @param string $meta_key The key of the meta field changed.
*
* @return void
*/
public function clear_author_sitemap_cache( $meta_id, $object_id, $meta_key ) {
if ( $meta_key === '_yoast_wpseo_profile_updated' ) {
WPSEO_Sitemaps_Cache::clear( [ 'author' ] );
}
}
}