Custom -switch to- link
-
Hi, and thanks for this plugin
Im trying to add a “switch to” link in a custom post type admin table column. I manage to create the link but I have problems with the
check_admin_referer()
stuff.I dont understand the nonce – and I propably missing something. This is my function call in the table column where my users are shown:
$u = The user_id
function ua_user_switch($u){ global $user_switching; $link = $user_switching->switch_to_url(switch_to_user( $u )); if(!$link) return false; echo '<a href="'.esc_url($link).'">'.esc_html( 'Switch To', 'user-switching' ).'</a>'; }
It works if I comment out this:
`# Check intent:
check_admin_referer( “switch_to_user_{$user_id}” );`Could someone help me out?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Custom -switch to- link’ is closed to new replies.