BLOG_ID_CURRENT_SITE improvement

I have an unusual installation where BLOG_ID_CURRENT_SITE = 3 instead of one.

Thus, in order to make the domain mapping work I had to change "1" by "BLOG_ID_CURRENT_SITE" in several files:

\domain-mapping\classes\Domainmap\Module\Ajax\Map.php
lines 322 & 363

\domain-mapping\classes\Domainmap\Module\Cdsso.php
lines 187, 239, 323 (also changed "===" to "==") & 648

\domain-mapping\classes\Domainmap\Module\Pages.php
line 88 (also changed '>' by '!=')

Would it be possible to implement the same change in future updates? Did I miss anything?

Thank you for your support.

Santi

  • Vinod Dalvi

    Hi Santi,

    I hope you are well today and thanks for posting on the forum.

    We can create a WordPress filter in the Domain Mapping plugin to change this current side id.

    I will move this over to the features & feedback section. This way it can be considered for future development, and we can also see what other community members think about the feature request.

    Thank you for being a WPMU DEV member and have a fantastic day!

    Cheers,
    Vinod Dalvi

  • Santi

    Hi Vinod,

    I do not follow what you mean with "Create filters".

    Let me clarify a bit here. The problem of your plugin is actually inherited from the original from Donncha. I guess very few people end up changing BLOG_ID_CURRENT_SITE wp-config.php like I did, and fewer still will also go with domain mapping!

    I just want to clarify that I am not asking you to spent a bunch of hours developing something for just me: the details that I included ARE the solution to the issue, so all that is needed is to verify that this is not breaking the code and that it makes sense... (and that I am not missing any other references to blog id's....)

    Let me explain: most every MS install, as per WP instructions, has the entry in wp-config.php "define('BLOG_ID_CURRENT_SITE') = 1;". In my case, it is not. All that needs to happen for everything to work is that when you refer in the code to blog_id ==1 (to exclude the main blog of the MS, etc), you refer instead to blog_id == BLOG_ID_CURRENT_SITE

    Of course I understand someone would have to test an verify it... I would be glad to send the files if that is helpful too...

    Cheers,

    Santi

  • Vinod Dalvi

    Hi Santi,

    Thank you for your reply.

    I understood your point now that instead of referring blog id static 1 or defining there any filter to change it, we can use the constant BLOG_ID_CURRENT_SITE there so that we can change it by assigning different value to it in the wp-config.php file.

    I have notified this to the plugin developer and this change will be implemented in the future versions of plugin.

    Cheers,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.