WPSEO_Admin::switch_theme
Log the updated timestamp for user profiles when theme is changed.
Метод класса: WPSEO_Admin{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WPSEO_Admin = new WPSEO_Admin(); $WPSEO_Admin->switch_theme();
Код WPSEO_Admin::switch_theme() WPSEO Admin::switch theme Yoast 27.6
public function switch_theme() {
$users = get_users( [ 'capability' => [ 'edit_posts' ] ] );
if ( is_array( $users ) && $users !== [] ) {
foreach ( $users as $user ) {
update_user_meta( $user->ID, '_yoast_wpseo_profile_updated', time() );
}
}
}