I’m wondering… how can I get the new post URL in my theme? Is there a built-in function for this?
So, it should return something like http://example.com/wp-admin/post-new.php?post_type=post.
Connor.
I’m wondering… how can I get the new post URL in my theme? Is there a built-in function for this?
So, it should return something like http://example.com/wp-admin/post-new.php?post_type=post.
Connor.
Comments are closed.
The
admin_url
function will handle generating most of the link, you just need to give it the final component. You can pass inGET
parameters as well. Just look at the backend URL to see what you need.Or using
add_query_arg
as suggested by @Rarst …It is overkill for simple URLs but useful for dynamic ones.