Custom Switch Page | WordPress.org

[ad_1]

Hello,
First of all, thank you for the plugin. I would like to say that it is very practical and useful.

I create a link as follows to use this plugin on a special page where users are listed on the WordPress admin page. However, after clicking on the link, I receive the following warning: “The link you followed has expired. Please try again.”
So the link is not working. Can you guide me? I wonder where the error is?
The code is below:

$user_id = get_post_field('post_author', $post_id);
$switch_url = wp_nonce_url( add_query_arg( array(
'action' => 'switch_to_user',
'user_id' => $user_id ,
'nr' => 1,
), wp_login_url() ), "switch_to_user_{ $user_id }" );

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer