Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Multisite and Databases question #412239

    Hello,
    You said “I believe this occurred because as LayerSlider is bundled with Enfold when the theme got network-activated it created those LS tables for all sites”

    I said in my question that the theme was NOT network activated. I made sure of that. Even so, creating tables should be done the first time the theme Activated through Appearance | Themes and not when it is network enabled. Maybe the after_switch_theme hook will do. That way it will only process that function when needed. Network Enabling a theme does not mean it is in use.

    After further research, the function layerslider_activation_scripts() on line 17 in activation.php specifically loops through each site and creates the new table. See lines 28-35:

    // Get all sites
    $sites = $wpdb->get_col(“SELECT blog_id FROM $wpdb->blogs”);

    // Iterate over the sites
    foreach($sites as $site) {
    switch_to_blog($site);
    layerslider_create_db_table();
    }

    This function gets kicked off when a theme is activated on a site like I suggested above. However, it runs this loop if it is multisite. The way it is written, I imagine it will get fired off each time the theme is activated on a new site. Can’t you just run the layerslider_create_db_table() function on the site the theme is activated on and omit this loop altogether?

    Thanks for your help!

    in reply to: Team Member – items not displaying #407568

    Actually, I think this issue is a result of having WPSuperCache enabled! I can see everything now. Sorry to bother you.

Viewing 2 posts - 1 through 2 (of 2 total)