In Admin, is there any way to use a slug instead of a post ID# within the URL that takes you to a post's edit screen.
So instead of:
.php?post=5562&action=edit
You would use something like:
.php?slug=home&action=edit
Or, since the database stores the slug in the column post-name
:
.php?post-name=home&action=edit
Of course, neither of these actually works. Is there some existing method for doing this using Wordpress' built-in URL parameters?
If not, what sort of function could be used in my theme's functions.php
file that would make this work?
In Admin, is there any way to use a slug instead of a post ID# within the URL that takes you to a post's edit screen.
So instead of:
http://example.com/wp-admin/post.php?post=5562&action=edit
You would use something like:
http://example.com/wp-admin/post.php?slug=home&action=edit
Or, since the database stores the slug in the column post-name
:
http://example.com/wp-admin/post.php?post-name=home&action=edit
Of course, neither of these actually works. Is there some existing method for doing this using Wordpress' built-in URL parameters?
If not, what sort of function could be used in my theme's functions.php
file that would make this work?
If the home page is set as "Home" in settings, use:
get_edit_post_link( get_option( 'page_on_front' ) );
admin-post.php
, do your lookup, and redirect to the normal admin url for that post. – Milo Commented Dec 17, 2014 at 19:13