Connections Business Directory
[resolved] Using One Connections DB across an entire Multisite (4 posts)

  1. EPICWebDesign
    Posted 3 years ago #

    I know it's been asked before, how to use one connections DB across a multisite.

    I found a pretty good, though not ideal, way to do this today.

    On line 254 of connections.php Change

    $prefix = ( is_multisite() && CN_MULTISITE_ENABLED ) ? $wpdb->prefix : $wpdb->base_prefix;


    $prefix = "wp_";

    This assumes two things.

    1. You change the prefix to match your first sites prefix. (wp_ in my case)
    2. You don't update Connections, or if you do, you make the same change.

    Presumably this could be built into connections as a dropdown that lists the prefix for all multisites to choose from. I know there's a blog ID, and name, not sure off hand if it's the same used in the prefixes or not.


  2. shazahm1
    Plugin Author

    Posted 3 years ago #

    @ EPICWebDesign

    Instead, just add this to your wp-config.php file:


    Connections will then use the same tables across the network. Essentially, what you're doing by hardcoding the prefix.

  3. EPICWebDesign
    Posted 3 years ago #

    Oh, that's easy enough.

    Is that documented somewhere? didn't see that when looking, and I thought you had specifically said it didn't work on a forum post.

  4. shazahm1
    Plugin Author

    Posted 3 years ago #

    @ EPICWebDesign

    This feature made its way in January or so ... so the forum post could have been older. Right now the only doc is in the code about 25 lines up from where you made your change.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Connections Business Directory
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic