Change URL of view button

Question

I have the following app made with WordPress. The image below is from :

http://hr-staging.localhost/wp-admin/users.php

enter image description here

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.

0
Pawan Rai 2 years 2020-12-18T06:10:26-05:00 0 Answers 11 views 0

Leave an answer

Browse
Browse