0

I want to know if exists some method from filters or actions to change the link of the Add New button in backend , for example the regular url is http://wordpress_install/wp-admin/post-new.php but I want to add an get parameter http://localsite/wp4/wp-admin/post-new.php?param=value. How to accomplish this.

0

This can be achieved by using the admin_url filter:

function add_new_post_url( $url, $path, $blog_id ) {

    if ( $path == "post-new.php" ) {
        $path = "post-new.php?param=value";
    }

    return $path;
}
add_filter( 'admin_url', 'add_new_post_url', 10, 3 ); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.