I want to change a role in my wordpress plugin.

            if ( is_admin() && ! is_user_logged_in() && ! defined( 'DOING_AJAX' ) && $pagenow !== 'admin-post.php' ) {
            wp_die( __( 'This has been disabled', 'wp-hide-login' ), 403 );
        }

        $request = parse_url( $_SERVER['REQUEST_URI'] );

When my plugin get the action, WordPress shows “This has been disabled” under WP default (admin-post.php) page.
But i need when my function get assign it’s redirect to 404 page.

As like as “This has been disabled” > http://www.example.com/404

Read more here: how to redirect WordPress 404 page through function()


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: