includes/class-freemius.php
private static function get_user_opted_in_module_ids_map( $fs_user_id ) {
            self::$_static_logger->entrance();

            if ( ! is_multisite() ) {
                $installs = array_merge(
                    self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN ),
                    self::get_all_sites( WP_FS__MODULE_TYPE_THEME )
                );
            } else {
                $sites = self::get_sites();

                $installs = array();
                foreach ( $sites as $site ) {
                    $blog_id = self::get_site_blog_id( $site );

                    $installs = array_merge(
                        $installs,
                        self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN, $blog_id ),
                        self::get_all_sites( WP_FS__MODULE_TYPE_THEME, $blog_id )
                    );
                }
            }

            $module_ids_map = array();
            foreach ( $installs as $install ) {
                if ( is_object( $install ) &&
                     FS_Site::is_valid_id( $install->id ) &&
                     FS_User::is_valid_id( $install->user_id ) &&
                     ( $install->user_id == $fs_user_id )
                ) {
                    $module_ids_map[ $install->plugin_id ] = true;
                }
            }

            return $module_ids_map;
        }
private static function get_user_opted_in_module_ids_map( $fs_user_id ) {
            self::$_static_logger->entrance();

            if ( ! is_multisite() ) {
                $installs = array_merge(
                    self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN ),
                    self::get_all_sites( WP_FS__MODULE_TYPE_THEME )
                );
            } else {
                $sites = self::get_sites();

                $installs = array();
                foreach ( $sites as $site ) {
                    $blog_id = self::get_site_blog_id( $site );

                    $installs = array_merge(
                        $installs,
                        self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN, $blog_id ),
                        self::get_all_sites( WP_FS__MODULE_TYPE_THEME, $blog_id )
                    );
                }
            }

            $module_ids_map = array();
            foreach ( $installs as $install ) {
                if ( is_object( $install ) &&
                     FS_Site::is_valid_id( $install->id ) &&
                     FS_User::is_valid_id( $install->user_id ) &&
                     ( $install->user_id == $fs_user_id )
                ) {
                    $module_ids_map[ $install->plugin_id ] = true;
                }
            }

            return $module_ids_map;
        }
private static function get_user_opted_in_module_ids_map ( $ fs_user_id ) { self :: $ _static_logger -> entrance ( ) ; if ( ! is_multisite ( ) ) { $ installs = array_merge ( self :: get_all_sites ( WP_FS__MODULE_TYPE_PLUGIN ) , self :: get_all_sites ( WP_FS__MODULE_TYPE_THEME ) ) ; } else { $ sites = self :: get_sites ( ) ; $ installs = array ( ) ; foreach ( $ sites as $ site ) { $ blog_id = self :: get_site_blog_id ( $ site ) ; $ installs = array_merge ( $ installs , self :: get_all_sites ( WP_FS__MODULE_TYPE_PLUGIN , $ blog_id ) , self :: get_all_sites ( WP_FS__MODULE_TYPE_THEME , $ blog_id ) ) ; } } $ module_ids_map = array ( ) ; foreach ( $ installs as $ install ) { if ( is_object ( $ install ) && FS_Site :: is_valid_id ( $ install -> id ) && FS_User :: is_valid_id ( $ install -> user_id ) && ( $ install -> user_id == $ fs_user_id ) ) { $ module_ids_map [ $ install -> plugin_id ] = true ; } } return $ module_ids_map ; }
Gets a map of module IDs that the given user has opted-in to.

@author Leo Fajardo (@leorw)
@since  2.1.0

@param number $fs_user_id

@return array {
@key number $plugin_id
@value bool Always true.
}
Gets a map of module IDs that the given user has opted - in to .