WPSEO_Admin::switch_theme()publicYoast 1.0

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() Yoast 22.4

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() );
		}
	}
}