Forums

getting wp_admin to work in admin (1 post)

  1. cognitions
    Member
    Posted 2 years ago #

    I am trying to redirect all admins to edit.php when they go to tools.php or import.php

    In a theme template this works perfectly:

    if( is_admin() && isset($pagenow) && ('tools.php' == $pagenow || 'import.php' == $pagenow)
    &&  ( empty($_SERVER[ 'QUERY_STRING' ]) ) ) {
    
    wp_redirect(($admin_url) . 'edit.php');
    			exit;
    		}

    But in a plugin it does not.
    I know I have to attach it to a function and add add_filter(wp_redirect....)
    but I am not quite sure ho.

Topic Closed

This topic has been closed to new replies.

About this Topic