Arrow

Admin link to Edit Post | Peter's Login Redirect | Forum

Back to the login redirect plugin page

Please consider registering
guest

Log In

Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Admin link to Edit Post
February 21, 2011
12:25 am
PaulR
Guest

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.

February 21, 2011
9:04 am
Peter
Admin
Forum Posts: 841
Offline

I don't think this plugin is the cause, because it doesn't affect links within posts.

February 21, 2011
5:12 pm
PaulR
Guest

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.

February 21, 2011
6:01 pm
Peter
Admin
Forum Posts: 841
Offline

Unfortunately, that's a problem that this plugin doesn't attempt to fix. If WordPress is forcing a redirection on certain operations, that's a WordPress configuration or general architecture issue.

Good luck!

February 21, 2011
7:55 pm
PaulR
Guest

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);
}
// ==============

February 21, 2011
11:31 pm
Peter
Admin
Forum Posts: 841
Offline

I'm glad it worked out for you. Thanks a lot for sharing your solution for others to benefit!