Admin link to Edit Post | Peter's Login Redirect | Forum
Back to the login redirect plugin page
12:25 am
This plugin seems to work great, but with one problem - In WP admin when I click on a link to edit a Post, it reverts to the old URL.
To be specific... We are using a subdomain URL to access WP Admin.
admin.website.com
This works & all links in WP Admin are, EG: admin.website.com/wp-admin/edit.php
However, once on the Edit post page, the links to the actual posts all revert to www.
5:12 pm
Sorry, I didnt quite explain that well enough.
The WP Admin "edit post" link reverts to www.
So, in WP Admin you go to edit posts & have a list of your articles. You can click on one to edit its content. That edit link uses the main site config full URL rather than the new URL you set.
I also found when you upload an image in the media library, the form you submit with your image posts to the main site config full URL.
7:55 pm
Yep, I realise now the scope of your plugin doesnt cover that.
However, I was able to add a custom hook to overcome my issue.
Here it is, incase anyone else should need it.
In conjunction with your plugin this works quite nicely, especially if, like me, you need to use a sub-domain for WP Admin.
Obviously the str_replace() would need changing for your circumstance.
FILE: /themes/{your_theme}/functions.php
// ==============
add_filter('admin_url', 'new_admin_url');
function new_admin_url($old_url){
return str_replace('http://www','http://admin',$old_url);
}
// ==============