Change URL of view button
I have the following app made with WordPress. The image below is from :
http://hr-staging.localhost/wp-admin/users.php
When hover over the view button the below URL is shown:
http://hr-staging.localhost/author/12/
When I click the view button I’m redirected to /wp-admin
page.
But I want to change the link of view button to:
domain.com/wp-admin/admin.php?page=user-detail&id=112
I’ve already created the tempate user-detail.php
and added the following hook in my plugin.
plugin/class/user.php
function init() {
add_filter('page_row_actions', array($this, 'view_user_detail'), 10, 2);
}
function view_user_detail($actions, $user){
$actions['view'] = '<a href="'.get_site_url().'/wp-admin/admin.php?page=user-detail&id='.$user->userID.'"></a>';
return $actions;
}
But the link of view button is still the same. I would be very thankful if someone could help me to figure it out.
Leave an answer