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

#2483
kardon
Participant

This is where I put it in base_lib

    protected function __construct($options_id) {

        $this->multisite = function_exists('is_multisite') && is_multisite();
        if ($this->multisite) {
            $this->blog_ids = $this->get_blog_ids();
            // get Id of 1st (main) blog
            $this->main_blog_id = $this->blog_ids[0][0];
        }

        $this->init_options($options_id);

    }
    // end of __construct()

    <strong>/**
     * Returns the main site IDs
     * @global $current_site
     * @return $current_site->blog_id
     */
    
    public function get_main_site() {
        global $current_site;
        
        return $current_site->blog_id;
    }
    // end of get_main_site()</strong>

    /**
     * Returns the array of multisite WP blogs IDs
     * @global wpdb $wpdb
     * @return array
     */
    protected function get_blog_ids() {
        global $wpdb;