/**
  * Fetch all blog IDs for Publisher blogs 
  */
 public static function podcast_blog_ids()
 {
     return array_filter(Network::blog_ids(), function ($blog_id) {
         return \Podlove\with_blog_scope($blog_id, function () {
             return is_plugin_active(plugin_basename(\Podlove\PLUGIN_FILE));
         });
     });
 }
 private static function is_active_in_main_blog()
 {
     global $current_site;
     return \Podlove\with_blog_scope($current_site->blog_id, function () {
         $module_active = \Podlove\Modules\Base::is_active('networks');
         $plugin_active = is_plugin_active(plugin_basename(\Podlove\PLUGIN_FILE));
         return $module_active && $plugin_active;
     });
 }
Example #3
0
/**
 * Hook: Activate the plugin.
 * 
 * In a single blog install, just call activate_for_current_blog().
 * However, in a multisite install, iterate over all blogs and call the activate
 * function for each of them.
 */
function activate($network_wide)
{
    global $wpdb;
    if ($network_wide) {
        set_time_limit(0);
        // may take a while, depending on network size
        $blogids = $wpdb->get_col("SELECT blog_id FROM " . $wpdb->blogs);
        foreach ($blogids as $blog_id) {
            \Podlove\with_blog_scope($blog_id, function () {
                activate_for_current_blog();
            });
        }
    } else {
        activate_for_current_blog();
    }
    set_transient('podlove_needs_to_flush_rewrite_rules', true);
    podlove_run_system_report();
}