Change WordPress user roles and capabilities Forums How to or FAQ Problem with shortcodes after moving WP to a new server Reply To: Problem with shortcodes after moving WP to a new server

#2466
kardon
Participant

OK, here is what I have learned.

I put thIS code in the theme functions.php
echo '</br> Main site ID theme functions.php: '. $current_site->blog_id;

and then also added it to the ure-lib.php.

    protected function init_options($options_id) {
        
        global $wpdb;

        if ($this->multisite) { 
            if ( ! function_exists( 'is_plugin_active_for_network' ) ) {    // Be sure the function is defined before trying to use it
                require_once( ABSPATH . '/wp-admin/includes/plugin.php' );                
            }
      
            $this->active_for_network = is_plugin_active_for_network(URE_PLUGIN_BASE_NAME);
        }
        $current_blog = $wpdb->blogid;
        if ($this->multisite && $current_blog!=$this->main_blog_id) {   
            if ($this->active_for_network) {   // plugin is active for whole network, so get URE options from the main blog
                switch_to_blog($this->main_blog_id);  
            }
        }
     
     echo '</br> Main site ID ure-lib: '. $current_site->blog_id.'  ';       
        $this->options_id = $options_id;
        $this->options = get_option($options_id);
        
        if ($this->multisite && $current_blog!=$this->main_blog_id) {
            if ($this->active_for_network) {   // plugin is active for whole network, so return back to the current blog
                restore_current_blog();
            }
        }

This is what it returns:

Main site ID ure-lib:
Main site ID theme functions.php: 1

I don’t know why it knows the value in one place and not the other. If you give me more direction I will do further analysis, though.

Thanks so very much for all your help with this!!