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.
Add a comment
|
1 Answer
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 );