qtranslate-xt
qtranslate-xt copied to clipboard
Not loading on backend when using custom path for `wp-admin`
Since I've a custom path for wp-admin
for security reasons, the check here is always failing when on admin pages. Seems like we are always doing_front_end
, so qtx_admin.php
is never loaded.
I fixed this changing the regex so that it matches my custom path, but would be nice to have here a wp filter so that we don't need to apply changes to the plugin codebase anymore.
It reminds me of something, this part is handled pretty bad in WP. There should be a function to retrieve this, but there's only get_admin_url (URL, not path) and wp_admin
is even hard-coded internally in WP... Do you get the correct path if run the admin_url
filter?
Yes I get the url with the right path, we could use this and rip off the protocol+domain part.
Still it feels like a hack to use get_admin_url
, it's not the same purpose and we should not assume about the http configuration.
I would also like to avoid adding a new filter just for this. Let's see if we can find a better solution.
The main problem is that WordPress doesn't handle this properly, it's hard-coded in WP, it's pretty bad :-/