http error domain mapping https-admin

I’m running a wordpress multisite instance and am using the WordPress MU Domain Mapping plugin. I have it setup such that when domain mapping is enabled for a site it only maps for the front-end. ALL sites use the original/same domain on the back-end. I am also using the WordPress HTTPS plugin to secure the back-end (mostly to secure the login process since we interface with an LDAP system).

Because of cross-domain issues and http vs https issues I’ve filtered the WordPress MU Domain Mapping plugin to disable mapping when Beaver Builder is active. With past versions of BB I was able to filter set_url_scheme to force https and modify the get_edit_url to match our original domain and everything worked fine. However, with a recent update set_url_scheme is only called if the post status is draft.

Is there any way a filter could be added to the FLBuilderModel get_edit_url method? Since there is nothing else filterable within that method my only other option seems to be to use remove_filter/action for default BB hooks and create my own, which feels very hacky.

If that’s not possible I’m open to other possible solutions.


I meant to mention that I’ve tried solutions listed in other threads such as:

I also tested the Front-End Editor plugin that Justin suggested in the Domain mapping issues thread and it suffered from the same “http error” problem when trying to upload an image. The problem I found in the past (when using BB and Domain Mapping) was that upon trying to upload the image the request hits the server and WP has no record of the user being logged in and therefore redirect the request to the login page. This seemed to be an issue with cookies not being set for the front-end (http) since the back-end login was via https. This was the reason that I just opted to force BB (and all editing for that matter) to use the site original url and https.

Can you tell me what version you updated from so I can see why we made that change in our commit history? I’m not opposed to adding set_url_scheme to get_edit_url when the post is not a draft, but I want to make sure doing so won’t break something we originally fixed.


I certainly understand. The version that I updated from was 1.5.6.

Thanks! I check that out today.

I did some digging through old commits/threads and it looks like there really was no good reason for us doing it this way. We used to set the scheme for the url whether published or draft, but the new code was modeled after some core code that did it a bit differently. So, I feel pretty confidant we can make this change without any issues. My tests show that everything works as expected.

I’ll get that out in the next update. In the meantime, you can change that method to this…

static public function get_edit_url( $post_id = false )
    if ( false === $post_id ) {
        global $post;
    else {
        $post = get_post( $post_id );

    return set_url_scheme( add_query_arg( 'fl_builder', '', get_permalink( $post->ID ) ) );

Thanks for taking the time to check into this, Justin. And thanks for the patch while I wait for the next release. I very much appreciate it!


You’re welcome!