Allow filtering of "Add New [Post Type]" URL on edit.php
|Reported by:||tbuteler||Owned by:|
I've recently attempted to use add_filter('admin_url','filter_function'), only to discover that there are many URLs in the admin area that are not passed through the admin_url() function. While there may be a good reason for that to happen, I figured it wouldn't hurt to check the possibility of changing one of them.
The one URL I haven't been able to find a workaround to is the "Add New [Post Type]" button on the edit.php screen, on top the post table, which also appears when editing an existing post. From what I gather, it is generated in the following file/line http://core.trac.wordpress.org/browser/trunk/wp-admin/edit.php#L189 for the first case, and on this one http://core.trac.wordpress.org/browser/trunk/wp-admin/edit-form-advanced.php#L198 for the second case.
Fixing this, assuming it's possible without compromising a functionality I'm not aware of, would be as simple as replacing this:
<a href="<?php echo $post_new_file ?>" ...
<a href="<?php echo esc_url( $post_new_file ) ?>" ...
<a href="<?php echo admin_url($post_new_file); ?>" ...
<a href="<?php echo esc_url( admin_url($post_new_file) ) ?>" ...