Пример #1
0
/**
 * Return an array of sites
 *
 * @return array array of site's blognames indexed by ID  
 */
function oik_ms_site_list()
{
    oik_require("shortcodes/oik-blogs.php", "oik-ms");
    $blogs = bw_get_blog_list();
    $site_select = array();
    foreach ($blogs as $blog) {
        $bloginfo = bw_get_bloginfo($blog);
        $site_select[$blog] = $bloginfo->blogname;
    }
    return $site_select;
}
Пример #2
0
/** 
 * Implement [bw_blogs] shortcode to list the blogs on the multisite
 * 
 * @param array $atts - expected to either contain "blogs" or uses the index 0 values
 * @param string $content - content to expand for each blog
 * @param string $tag - the shortcode used
 * @return string - nothing is generated directly by this shortcode
 */
function bw_blogs($atts = null, $content = null, $tag = null)
{
    if (is_multisite()) {
        $blogs = bw_array_get_from($atts, "blogs,0", null);
        if ($blogs) {
            $blogs = bw_as_array($blogs);
        } else {
            $blogs = bw_get_blog_list();
        }
        bw_display_blogs($blogs, $atts, $content);
    } else {
        bw_trace2("bw_blogs shortcode not effective in a non-multisite implementation");
    }
    return bw_ret();
}