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

#2478
kardon
Participant
protected function init_options($options_id) {
        
        global $wpdb;

        if (รง) { 
            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);  
            }
        }
     
            
        $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();
            }
        }
         <strong>echo '</br> ure-lib:$this->multisite '. $this->multisite;
         echo '</br> ure-lib:$current_blog: '. $current_blog;
         echo '</br> ure-lib:$this->main_blog_id: '. $this->main_blog_id;
         echo '</br> ure-lib:this->active_for_network: '. $this->active_for_network;</strong>

    }
    // end of init_options()

This code that echos the exact variable names used in the function returns this:
ure-lib:$this->multisite 1
ure-lib:$current_blog: 38
ure-lib:$this->main_blog_id:
ure-lib:this->active_for_network: 1

I then added the global line you mentioned and the echo of it.
ure-lib:$current_site->blog_id 1
ure-lib:$this->multisite 1
ure-lib:$current_blog: 38
ure-lib:$this->main_blog_id:
ure-lib:this->active_for_network: 1

Does this provide any clue to the problem?