• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_blog_list函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_blog_list函数的典型用法代码示例。如果您正苦于以下问题:PHP get_blog_list函数的具体用法?PHP get_blog_list怎么用?PHP get_blog_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_blog_list函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: ajax_load

function ajax_load()
{
    if (isset($_GET['action'])) {
        if ($_GET['action'] == 'menu') {
            get_menu_list();
            exit;
        }
        if ($_GET['action'] == 'category_list') {
            get_category_list();
            exit;
        }
        if ($_GET['action'] == 'blog_list') {
            get_blog_list();
            exit;
        }
        if ($_GET['action'] == 'lol_list') {
            get_lol_list();
            exit;
        }
        if ($_GET['action'] == 'lol_hero_list') {
            get_lol_hero_list();
            exit;
        }
        if ($_GET['action'] == 'lol_info') {
            get_lol_info();
            exit;
        }
    }
}
开发者ID:sqlwang,项目名称:my_wpblog,代码行数:29,代码来源:functions.php


示例2: status

 /**
  * Example subcommand
  *
  * @param array   $args
  */
 function status($args, $assoc_args)
 {
     if (is_multisite()) {
         $blog_list = get_blog_list(0, 'all');
     } else {
         $blog_list = array();
         $blog_list[] = array('blog_id' => 1);
     }
     foreach ($blog_list as $blog) {
         if (is_multisite()) {
             switch_to_blog($blog['blog_id']);
         }
         $field_groups = get_posts(array('numberposts' => -1, 'post_type' => 'acf-field-group', 'sort_column' => 'menu_order', 'order' => 'ASC'));
         WP_CLI::line(' ');
         WP_CLI::line(count($field_groups) . ' field groups found for blog_id ' . $blog['blog_id']);
         if (!empty($field_groups)) {
             foreach ($field_groups as $group) {
                 WP_CLI::line('- ' . sanitize_title($group->post_title));
             }
         }
         WP_CLI::line(' ');
         if (is_multisite()) {
             restore_current_blog();
         }
     }
 }
开发者ID:scotto77,项目名称:advanced-custom-fields-wpcli,代码行数:31,代码来源:ACF5_Command.php


示例3: locked

 /**
  * Check if plugin is locked
  *
  * @return boolean
  */
 function locked()
 {
     static $locked = null;
     if ($locked === null) {
         if (w3_is_wpmu()) {
             if (isset($_GET['sitewide'])) {
                 $locked = false;
             } else {
                 global $blog_id;
                 $blogs = get_blog_list();
                 foreach ($blogs as $blog) {
                     if ($blog['blog_id'] != $blog_id) {
                         $active_plugins = get_blog_option($blog['blog_id'], 'active_plugins');
                         if (in_array(W3TC_FILE, $active_plugins)) {
                             $locked = true;
                             break;
                         }
                     }
                 }
             }
         } else {
             $locked = false;
         }
     }
     return $locked;
 }
开发者ID:kennethreitz-archive,项目名称:wordpress-skeleton,代码行数:31,代码来源:Plugin.php


示例4: SetupMenu

 function SetupMenu()
 {
     if (!empty($this->menu)) {
         return;
     }
     /*$this->menu = array(
     			'url' => array(
     				0 => array(
     					'id' => 0, // >39 = right-hand side
     					'title' => 'Title',
     					'url' => 'http://.../',
     				),
     				//1 => array(...) - submenu
     			),
     			'eh' => array(
     				0 => array(
     					'id' => 40, // >39 = right-hand side
     					'title' => 'Title',
     					'url' => 'http://.../',
     				),
     				//1 => array(...) - submenu
     			),
     		);*/
     global $wpdb;
     $this->menu['switch'] = array(0 => array('id' => 0, 'title' => 'Switch Theme Preview', 'url' => '#'));
     foreach (get_blog_list() as $blog) {
         $this->menu['switch'][] = array('id' => $blog['blog_id'], 'title' => get_blog_option($blog['blog_id'], "blogname"), 'url' => 'http://' . $blog['domain'] . $blog['path']);
     }
 }
开发者ID:rmccue,项目名称:blog-switcher-bar,代码行数:29,代码来源:blog-switcher-bar.php


示例5: blog_list_block

function blog_list_block($options)
{
    $mydirname = empty($options[0]) ? 'xpress' : $options[0];
    $this_template = empty($options[1]) ? 'db:' . $mydirname . '_block_category.html' : trim($options[1]);
    $orderby = empty($options[2]) ? 'name' : $options[2];
    $order = empty($options[3]) ? 'ASC' : $options[3];
    if (xpress_is_multiblog() && function_exists('get_blog_list')) {
        $blogs = get_blog_list(0, 'all');
        $data = array();
        foreach ($blogs as $blog) {
            $url = get_blog_option($blog['blog_id'], 'siteurl');
            $blog_name = get_blog_option($blog['blog_id'], 'blogname');
            $blog_link = "<a href=\" {$url} \"> {$blog_name} </a>";
            $blog_id = $blog['blog_id'];
            $post_count = $blog['postcount'];
            $last_post_date = '';
            $last_post_time = '';
            $last_post_date_time = '';
            $row_data = array('blog_id' => $blog_id, 'blog_name' => $blog_link, 'last_post_date' => $last_post_date, 'last_post_time' => $last_post_time, 'post_date_time' => $last_post_date_time, 'last_post_date_time' => $post_modified_date, 'post_count' => $post_count);
            $data[] = $row_data;
        }
        if (strcmp($order, 'ASC') == 0) {
            switch ($orderby) {
                case 'count':
                    usort($data, "r_post_count_cmp");
                    break;
                case 'ID':
                    usort($data, "r_blog_id_cmp");
                    break;
                default:
                    usort($data, "r_blog_name_cmp");
            }
        } else {
            switch ($orderby) {
                case 'count':
                    usort($data, "post_count_cmp");
                    break;
                case 'ID':
                    usort($data, "blog_id_cmp");
                    break;
                default:
                    usort($data, "blog_name_cmp");
            }
        }
        $block = array();
        $item_no = 0;
        foreach ($data as $row) {
            $block['contents']['item' . $item_no] = $row;
            $item_no++;
        }
        // end of foreach
        $block['data_count'] = $item_no;
        //xml unserialise error
    } else {
        $block['err_message'] = __('This blog is not set to the multi blog.', 'xpress');
    }
    return $block;
}
开发者ID:nouphet,项目名称:rata,代码行数:58,代码来源:blog_list_block_theme.php


示例6: get_all_blog_comments

/**
 * Returns a sorted array of all comments across all blogs on the MU install
 *
 * @param int $num_per_blog The number of posts per blog to return
 * @param string $orderby The column to sort on. Uses the same {@link http://codex.wordpress.org/Function_Reference/get_comments#Parameters Order By Paramaters as get_comments}
 * @param string $sort The field in the comment object to be used in the quicksort
 * @return array Sorted array of posts
 */
function get_all_blog_comments($num_per_blog = 1, $orderby = 'comment_date_gmt', $sort = 'comment_date_gmt')
{
    $comments = array();
    $blogs = get_blog_list(0, 'all');
    foreach ($blogs as $blog) {
        switch_to_blog($blog['blog_id']);
        $comments = array_merge($comments, get_comments('orderby=' . $orderby . '&number=' . $num_per_blog));
        restore_current_blog();
    }
    return _quicksort($comments, $sort);
}
开发者ID:xentek,项目名称:mu-helpers,代码行数:19,代码来源:mu-helpers.php


示例7: uninstall_sitewidely

 public function uninstall_sitewidely()
 {
     $blogs = get_blog_list(0, 'all', false);
     if (is_array($blogs)) {
         reset($blogs);
         foreach ((array) $blogs as $key => $details) {
             switch_to_blog($details['blog_id']);
             self::uninstall();
             restore_current_blog();
         }
     }
 }
开发者ID:masayukiando,项目名称:wordpress-event-search,代码行数:12,代码来源:install.php


示例8: install

 public static function install($network_wide)
 {
     global $wpdb;
     if (is_multisite() && $network_wide) {
         $tmpPrefix = $wpdb->prefix;
         $blogs = function_exists('wp_get_sites') ? wp_get_sites(array('network_id' => $wpdb->siteid)) : get_blog_list(0, 'all');
         foreach ($blogs as $blog) {
             $wpdb->prefix = $wpdb->get_blog_prefix($blog['blog_id']);
             N2Base::getApplication("system")->getApplicationType('backend')->render(array("controller" => "install", "action" => "index", "useRequest" => false), array(true));
         }
         $wpdb->prefix = $tmpPrefix;
         return true;
     }
     N2Base::getApplication("system")->getApplicationType('backend')->render(array("controller" => "install", "action" => "index", "useRequest" => false), array(true));
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:15,代码来源:nextend.php


示例9: sap_metabox

function sap_metabox($post)
{
    $values = get_post_custom($post->ID);
    $site_id = isset($values['sap_site_id']) ? esc_attr($values['sap_site_id'][0]) : '';
    $background_color = isset($values['sap_background_color']) ? esc_attr($values['sap_background_color'][0]) : '';
    $text_color = isset($values['sap_text_color']) ? esc_attr($values['sap_text_color'][0]) : '';
    wp_nonce_field('sap_metabox_nonce', 'metabox_nonce');
    echo 'Location for this announcement: <b>' . $site_id . '</b><br><br>';
    echo '<br>values var_dump: ';
    var_dump($values);
    $blog_list = get_blog_list(0, 'all');
    $sites = array();
    foreach ($blog_list as $blog) {
        $sites[] = $blog['domain'] . $blog['path'];
    }
    ?>

    <select name="sap_site_id" id="sap_site_id">
        <?php 
    foreach ($sites as $site) {
        echo '<option value="' . $site . '">' . $site . '</option>';
    }
    ?>
    </select>

    <p>Select Background Color</p>
    <input name="sap_background_color" type="text" value="<?php 
    echo $background_color;
    ?>
" class="my-color-field" />
    <p>Select Text Color</p>
    <input name="sap_text_color" type="text" value="<?php 
    echo $text_color;
    ?>
" class="my-color-field" />
    <script type="text/javascript">
    jQuery(document).ready(function($){
        $('.my-color-field').wpColorPicker();
    });
    </script>
    <?php 
}
开发者ID:klgrimley,项目名称:child-domain-identifier,代码行数:42,代码来源:index.php


示例10: bloglist_shortcode

function bloglist_shortcode($atts)
{
    if (!function_exists('get_blog_list')) {
        return;
    }
    $blogs = get_blog_list();
    if (!$blogs) {
        return '';
    }
    extract(shortcode_atts(array('showcurrent' => 'no'), $atts));
    if ($showcurrent == '0' || $showcurrent == 'no' || $showcurrent == 'false') {
        $showcurrent = false;
    } else {
        $showcurrent = true;
    }
    ob_start();
    ?>
<ul class="blog-list">
    <?php 
    foreach ($blogs as $blog) {
        if ($blog['blog_id'] == get_current_blog_id() && !$showcurrent) {
            continue;
        }
        ?>
    <li><a href="<?php 
        echo get_blog_option($blog['blog_id'], 'siteurl');
        ?>
"><?php 
        echo get_blog_option($blog['blog_id'], 'blogname');
        ?>
</a></li>
    <?php 
        switch_to_blog($cblog_id);
    }
    ?>
</ul>
    <?php 
    $result = ob_get_clean();
    return $result;
}
开发者ID:cabelotaina,项目名称:redelivre,代码行数:40,代码来源:blog-list.php


示例11: get_postslist_table

 function get_postslist_table($author_lk)
 {
     global $wpdb, $post, $posts, $ratings;
     $ratings = array();
     $posts = array();
     //print_r($_POST);
     //exit;
     $start = $this->start . ',';
     $posts[] = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->base_prefix . "posts WHERE post_author='%d' AND post_type='%s' AND post_status NOT IN ('draft','auto-draft') ORDER BY post_date DESC LIMIT {$start} 20", $author_lk, $this->posttype));
     if (is_multisite()) {
         $blog_list = get_blog_list(0, 'all');
         foreach ($blog_list as $blog) {
             $pref = $wpdb->base_prefix . $blog['blog_id'] . '_posts';
             $posts[] = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $pref . " WHERE post_author='%d' AND post_type='%s' AND post_status NOT IN ('draft','auto-draft') ORDER BY post_date DESC LIMIT {$start} 20", $author_lk, $this->posttype));
         }
     }
     if ($posts[0]) {
         $p_list = array();
         if (function_exists('rcl_format_rating')) {
             foreach ($posts as $postdata) {
                 foreach ($postdata as $p) {
                     $p_list[] = $p->ID;
                 }
             }
             $rayt_p = rcl_get_ratings(array('object_id' => $p_list, 'rating_type' => array($this->posttype)));
             foreach ((array) $rayt_p as $r) {
                 if (!isset($r->object_id)) {
                     continue;
                 }
                 $ratings[$r->object_id] = $r->rating_total;
             }
         }
         $posts_block = rcl_get_include_template('posts-list.php', __FILE__);
         wp_reset_postdata();
     } else {
         $posts_block = '<p>' . $this->name . ' ' . __('has not yet been published', 'wp-recall') . '</p>';
     }
     return $posts_block;
 }
开发者ID:stanislav-chechun,项目名称:campus-rize,代码行数:39,代码来源:rcl_postlist.php


示例12: locked

 /**
  * Check if plugin is locked
  *
  * @return boolean
  */
 function locked()
 {
     static $locked = null;
     if ($locked === null) {
         if (w3_is_network() && function_exists('get_blog_list')) {
             global $blog_id;
             $blogs = get_blog_list();
             foreach ($blogs as $blog) {
                 if ($blog['blog_id'] != $blog_id) {
                     $active_plugins = get_blog_option($blog['blog_id'], 'active_plugins');
                     if (in_array(W3TC_FILE, $active_plugins)) {
                         $locked = true;
                         break;
                     }
                 }
             }
         } else {
             $locked = false;
         }
     }
     return $locked;
 }
开发者ID:niko-lgdcom,项目名称:archives,代码行数:27,代码来源:Plugin.php


示例13: locked

 /**
  * Check if plugin is locked
  *
  * @return boolean
  */
 function locked()
 {
     global $blog_id;
     static $locked = null;
     if ($locked === null) {
         $locked = false;
         // check only for WP MU
         if ($blog_id && function_exists('get_blog_option')) {
             $blogs = get_blog_list();
             foreach ($blogs as $blog) {
                 if ($blog['blog_id'] != $blog_id) {
                     $active_plugins = get_blog_option($blog['blog_id'], 'active_plugins');
                     if (in_array(W3TC_FILE, $active_plugins)) {
                         $locked = true;
                         break;
                     }
                 }
             }
         }
     }
     return $locked;
 }
开发者ID:TheReaCompany,项目名称:pooplog,代码行数:27,代码来源:Plugin.php


示例14: render

    function render()
    {
        $this->open_section_box($this->id, __("Select Source", "ns-cloner"));
        ?>
		<label class="ns-cloner-site-search-label">Search by url</label>
		<input type="text" class="ns-cloner-site-search" />
		<label class="ns-cloner-site-select-label">Or select</label>
		<select name="source_id" class="ns-cloner-site-select">
			<?php 
        $sites = function_exists('wp_get_sites') ? wp_get_sites(array('limit' => 9999)) : get_blog_list(0, 'all');
        ?>
			<?php 
        foreach ($sites as $site) {
            ?>
			<option value="<?php 
            echo $site['blog_id'];
            ?>
">
				<?php 
            $title = get_blog_details($site['blog_id'])->blogname;
            ?>
				<?php 
            $url = is_subdomain_install() ? "{$site['domain']}" : "{$site['domain']}{$site['path']}";
            ?>
				<?php 
            echo "{$site['blog_id']} - " . substr($title, 0, 30) . " ({$url})";
            ?>
		  <?php 
        }
        ?>
		</select>
		<p class="description ns-cloner-clear"><?php 
        _e('Pick an existing source site to clone. If you haven\'t already, now is a great time to set up a "template" site exactly the way you want the new clone site to start out (theme, plugins, settings, etc.).', 'ns-cloner');
        ?>
</p>
		<?php 
        $this->close_section_box();
    }
开发者ID:alpual,项目名称:Caitlin-Sabo,代码行数:38,代码来源:ns-cloner-section-select-source.php


示例15: widget_endView

 function widget_endView($args)
 {
     if (!is_super_admin()) {
         return;
     }
     if (get_option('diamond_allow_broadcast') == 0) {
         return;
     }
     global $wpdb;
     echo '<fieldset><legend>';
     echo __('Broadcast this post', 'diamond');
     echo '</legend>';
     echo '<label>';
     echo __('Select blogs where you want to copy this post', 'diamond');
     echo '<select name="diamond_blogs[]" id="diamond_blogs" style="height:120px; width: 100%"  multiple="multiple">';
     echo '<option value="0">';
     _e('--- No broadcast ---', 'diamond');
     echo '</option>';
     $blog_list = get_blog_list();
     $shared = get_post_custom_values('diamond_broadcast_blogs', $_GET['post'] ? $_GET['post'] : 0);
     $sharr = split(";", $shared[0]);
     foreach ($blog_list as $blog) {
         if ($blog['blog_id'] != $wpdb->blogid) {
             echo '<option value="' . $blog['blog_id'] . '">' . get_blog_option($blog['blog_id'], 'blogname');
         }
         if ($sharr && in_array($blog['blog_id'], $sharr)) {
             echo __(' (copied)', 'diamond');
         }
         echo '</option>';
     }
     echo '</select>';
     echo '</label>';
     //print_r($shared[0]);
     //print_r($sharr)	;
     //print_r($shared);
     echo '</fieldset>';
 }
开发者ID:Wikipraca,项目名称:Wikipraca-WikiSquare,代码行数:37,代码来源:diamond-broadcast-posts.php


示例16: get_most_active_blogs

function get_most_active_blogs($num = 10, $display = true)
{
    $most_active = get_site_option("most_active");
    $update = false;
    if (is_array($most_active)) {
        if ($most_active['time'] + 60 < time()) {
            // cache for 60 seconds.
            $update = true;
        }
    } else {
        $update = true;
    }
    if ($update == true) {
        unset($most_active);
        $blogs = get_blog_list(0, 'all', false);
        // $blog_id -> $details
        if (is_array($blogs)) {
            reset($blogs);
            foreach ((array) $blogs as $key => $details) {
                $most_active[$details['blog_id']] = $details['postcount'];
                $blog_list[$details['blog_id']] = $details;
                // array_slice() removes keys!!
            }
            arsort($most_active);
            reset($most_active);
            foreach ((array) $most_active as $key => $details) {
                $t[$key] = $blog_list[$key];
            }
            unset($most_active);
            $most_active = $t;
        }
        update_site_option("most_active", $most_active);
    }
    if ($display == true) {
        if (is_array($most_active)) {
            reset($most_active);
            foreach ((array) $most_active as $key => $details) {
                $url = clean_url("http://" . $details['domain'] . $details['path']);
                echo "<li>" . $details['postcount'] . " <a href='{$url}'>{$url}</a></li>";
            }
        }
    }
    return array_slice($most_active, 0, $num);
}
开发者ID:joelglennwright,项目名称:agencypress,代码行数:44,代码来源:wpmu-functions.php


示例17: elseif

 } elseif (!isset($_POST['ext']) || !array_key_exists($_POST['ext'], $extensions)) {
     wp_die('Please select a valid extension.');
 } elseif (!isset($_POST['e2e_post_type']) || !array_key_exists($_POST['e2e_post_type'], $post_types) && $_POST['e2e_post_type'] != 'comment_authors' && $_POST['e2e_post_type'] != 'attachment') {
     wp_die('Please select a post type.');
 } elseif (!isset($_POST['post_fld']) && $_POST['e2e_post_type'] == 'post') {
     wp_die('Please select fields.');
 } elseif (!isset($_POST['page_fld']) && $_POST['e2e_post_type'] == 'page') {
     wp_die('Please select fields.');
 } elseif (!isset($_POST['comment_authors_fld']) && $_POST['e2e_post_type'] == 'comment_authors') {
     wp_die('Please select fields.');
 } else {
     $post_type = $_POST['e2e_post_type'];
     $ext = $_POST['ext'];
     $str = '';
     if (is_multisite() && $network_admin) {
         $blog_info = get_blog_list(0, 'all');
         foreach ($blog_info as $blog) {
             switch_to_blog($blog['blog_id']);
             include 'loop.php';
             restore_current_blog();
         }
     } else {
         include 'loop.php';
     }
     $filename = sanitize_file_name(get_bloginfo('name')) . '.' . $ext;
     if ($ext == 'xls') {
         header("Content-type: application/vnd.ms-excel;");
     } elseif ($ext == 'xlsx') {
         header("Content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, charset=utf-8;");
     }
     header("Content-Disposition: attachment; filename=" . $filename);
开发者ID:sekane81,项目名称:ratoninquietoweb,代码行数:31,代码来源:select_criteria.php


示例18: ns_get_multisite_upload_paths

/**
 * Return an array of all blog upload dir paths
 */
function ns_get_multisite_upload_paths($args = array('limit' => 9999))
{
    $upload_paths = array();
    $sites = function_exists('wp_get_sites') ? wp_get_sites($args) : get_blog_list(0, 'all');
    foreach ($sites as $site) {
        switch_to_blog($site['blog_id']);
        $wp_upload_dir = wp_upload_dir();
        $upload_paths[$site['blog_id']] = $wp_upload_dir['basedir'];
        restore_current_blog();
    }
    return $upload_paths;
}
开发者ID:alpual,项目名称:Caitlin-Sabo,代码行数:15,代码来源:ns-file-utils.php


示例19: xpress_primary_blog_link

function xpress_primary_blog_link() {
	global $xoops_config;
	global $current_user;
	global $blog_id;
	$ret = array();

	if (xpress_is_multiblog() && is_user_logged_in()){
		$blog_list = get_blog_list();
		$root_path = get_blog_status(1,'path');
		$primary_blog_id = @$current_user->primary_blog;
		if(empty($primary_blog_id)) return $ret;
		$primary_path = get_blog_status($primary_blog_id,'path');
		$script = str_replace($root_path, "", $primary_path);
		if ($primary_blog_id !== $blog_id){
			$ret['url'] = get_blogaddress_by_id($primary_blog_id);
			$ret['menu_url'] = $script;
			$ret['title'] = __('Your Primary Blog','xpressme');
			$ret['link'] = '<a href="' . $ret['url'] . '">' . $ret['title'] . '</a>';
		}
	}
	return $ret;
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:22,代码来源:custom_functions.php


示例20: upgrade

 /**
  * Upgrades the settings.
  * 
  * ## OPTIONS
  * 
  * [--network-wide]
  * : Perform the settings upgrade on all blogs of the network.
  * 
  * ## EXAMPLES
  * 
  *     wp amt upgrade
  *     wp amt upgrade --network-wide
  *
  * @synopsis [--network-wide]
  */
 function upgrade($args, $assoc_args)
 {
     // Multisite
     if ($assoc_args['network-wide']) {
         if (is_multisite()) {
             $blog_list = get_blog_list(0, 'all');
             if (empty($blog_list)) {
                 WP_CLI::error('No blogs could be found.');
             }
             foreach ($blog_list as $blog) {
                 switch_to_blog($blog['blog_id']);
                 $plugin_info = get_plugin_data(plugin_dir_path(__FILE__) . 'add-meta-tags.php', $markup = true, $translate = true);
                 WP_CLI::line('Upgrading settings of: ' . get_bloginfo('name') . ' - (ID: ' . $blog['blog_id'] . ')');
                 amt_plugin_upgrade();
                 restore_current_blog();
             }
             WP_CLI::success('Add-Meta-Tags settings have been upgraded network wide.');
         } else {
             WP_CLI::warning('No network detected. Reverting to signle site settings upgrade.');
         }
     }
     // Single site installation
     amt_plugin_upgrade();
     WP_CLI::success('Add-Meta-Tags settings have been upgraded.');
     /*
             if ( is_multisite() ) {
                 $blog_list = get_blog_list( 0, 'all' );
             } else {
                 $blog_list   = array();
                 $blog_list[] = array( 'blog_id' => 1 );
             }
     
             foreach ( $blog_list as $blog ) {
                 if ( is_multisite() ) {
                     switch_to_blog( $blog['blog_id'] );
                 }
                 $plugin_info = get_plugin_data( plugin_dir_path( __FILE__ ) . 'add-meta-tags.php', $markup = true, $translate = true );
                 WP_CLI::line( 'Upgrading settings of: ' . get_bloginfo('name') . ' - (ID: ' . $blog['blog_id'] . ')' );
                 amt_plugin_upgrade();
                 if ( is_multisite() ) {
                     restore_current_blog();
                 }
             }
     */
     // get_plugin_data( $plugin_file, $markup = true, $translate = true )
     //$plugin info = get_plugin_data( AMT_PLUGIN_DIR . 'add-meta-tags.php', $markup = true, $translate = true );
     // WP_CLI::line( ' ' );
     // WP_CLI::line( count( $field_groups ) . ' field groups found for blog_id ' . $blog['blog_id'] );
     // Print a success message
     //WP_CLI::success( "Operation complete." );
 }
开发者ID:pytong,项目名称:research-group,代码行数:66,代码来源:amt-cli.php



注:本文中的get_blog_list函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_blog_option函数代码示例发布时间:2022-05-15
下一篇:
PHP get_blog_lang_code函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap