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

PHP get_blog_details函数代码示例

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

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



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

示例1: widget

    function widget($args, $instance)
    {
        global $wpdb;
        $blog_id = isset($instance['blog_id']) ? $instance['blog_id'] : 1;
        $show_banner = isset($instance['show_banner']) ? $instance['show_banner'] : 1;
        $title = isset($instance['title']) ? $instance['title'] : '';
        $blog = get_blog_details($blog_id);
        $img = get_blog_option($blog_id, 'header_img');
        if ($show_banner == 0 || empty($img)) {
            $img = $blog->blogname;
        } else {
            $img = '<img src="' . $img . '" alt="' . str_replace('"', '', $blog->blogname) . '"/>';
        }
        echo $args['before_widget'];
        if ($title != '') {
            echo $args['before_title'] . $title . $args['after_title'];
        }
        echo $args['before_content'];
        ?>
      <a href="<?php 
        echo $blog->siteurl;
        ?>
"><?php 
        echo $img;
        ?>
</a>
      <?php 
        echo $args['after_content'] . $args['after_widget'];
    }
开发者ID:Wikipraca,项目名称:Wikipraca-WikiSquare,代码行数:29,代码来源:multisite-widget-link.php


示例2: sitesettings_get_blog_subdomain

function sitesettings_get_blog_subdomain()
{
    $blog_details = get_blog_details(get_current_blog_id());
    $domain = $blog_details->domain;
    $domain = explode('.', $domain);
    return $domain[0];
}
开发者ID:sebjon-bytbil,项目名称:BB.CMS,代码行数:7,代码来源:functions.php


示例3: is_ip_site

 /**
  *
  * @param string $name Name of the IP site being checked.
  *
  * @return bool
  */
 public function is_ip_site($name)
 {
     $site = get_blog_details();
     $home_domain = apply_filters('ip_home_domain', 'ip.wsu.edu');
     $home_path = apply_filters('ip_home_path', '/');
     $future_students_domain = apply_filters('ip_future_students_domain', 'ip.wsu.edu');
     $future_students_path = apply_filters('ip_future_students_path', '/future-students/');
     $study_english_domain = apply_filters('ip_study_english_domain', 'ip.wsu.edu');
     $study_english_path = apply_filters('ip_study_english_path', '/learn-english/');
     $study_abroad_domain = apply_filters('ip_study_abroad_domain', 'ip.wsu.edu');
     $study_abroad_path = apply_filters('ip_study_abroad_path', '/study-abroad/');
     $scholars_abroad_domain = apply_filters('ip_scholars_abroad_domain', 'ip.wsu.edu');
     $scholars_abroad_path = apply_filters('ip_scholars_abroad_path', '/scholars-abroad/');
     $on_campus_domain = apply_filters('ip_on_campus_domain', 'ip.wsu.edu');
     $on_campus_path = apply_filters('ip_on_campus_path', '/on-campus/');
     if ('ip-home' === $name && $home_domain === $site->domain && $home_path === $site->path) {
         return true;
     }
     if ('future-students' === $name && $future_students_domain === $site->domain && $future_students_path === $site->path) {
         return true;
     }
     if ('study-english' === $name && $study_english_domain === $site->domain && $study_english_path === $site->path) {
         return true;
     }
     if ('study-abroad' === $name && $study_abroad_domain === $site->domain && $study_abroad_path === $site->path) {
         return true;
     }
     if ('scholars-abroad' === $name && $scholars_abroad_domain === $site->domain && $scholars_abroad_path === $site->path) {
         return true;
     }
     if ('on-campus' === $name && $on_campus_domain === $site->domain && $on_campus_path === $site->path) {
         return true;
     }
     return false;
 }
开发者ID:ssheilah,项目名称:ip.wsu.edu,代码行数:41,代码来源:functions.php


示例4: metabox

    public function metabox()
    {
        // Inform user no CPTs available to be shown.
        if (empty($this->sites)) {
            echo '<p>' . __('No items.') . '</p>';
            return;
        }
        global $nav_menu_selected_id;
        $html = '<ul id="multisite-nav-list">';
        foreach ($this->sites as $site) {
            $blog = get_blog_details($site['blog_id']);
            $html .= '<h4>' . $blog->blogname . ' Pages</h4>';
            foreach ($site['pages'] as $pt) {
                $html .= sprintf('<li>
					<label>
					<input type="hidden" name="blogId" value="' . $blog->blog_id . '">
					<input type="checkbox" value="%s" />&nbsp;%s</label></li>', $pt->ID, $pt->post_title);
            }
        }
        $html .= '</ul>';
        // 'Add to Menu' button
        $html .= '<p class="button-controls"><span class="add-to-menu">';
        $html .= '<input type="submit"' . disabled($nav_menu_selected_id, 0, false) . ' class="button-secondary
			  submit-add-to-menu right" value="' . esc_attr__('Add to Menu', 'hptal-textdomain') . '"
			  name="add-post-type-menu-item" id="submit-post-type-archives" />';
        $html .= '<span class="spinner"></span>';
        $html .= '</span></p>';
        print $html;
    }
开发者ID:ryan2407,项目名称:Vision,代码行数:29,代码来源:index.php


示例5: init_with_multisite

 /**
  * @internal
  * @param string|int $site_name_or_id
  */
 protected function init_with_multisite($site_name_or_id)
 {
     if ($site_name_or_id === null) {
         //this is necessary for some reason, otherwise returns 1 all the time
         if (is_multisite()) {
             restore_current_blog();
             $site_name_or_id = get_current_blog_id();
         }
     }
     $info = get_blog_details($site_name_or_id);
     $this->import($info);
     $this->ID = $info->blog_id;
     $this->id = $this->ID;
     $this->name = $this->blogname;
     $this->title = $this->blogname;
     $this->url = $this->siteurl;
     $theme_slug = get_blog_option($info->blog_id, 'stylesheet');
     $this->theme = new TimberTheme($theme_slug);
     $this->language = get_bloginfo('language');
     $this->charset = get_bloginfo('charset');
     $this->pingback_url = get_bloginfo('pingback_url');
     $this->language_attributes = TimberHelper::function_wrapper('language_attributes');
     $this->description = get_blog_option($info->blog_id, 'blogdescription');
     $this->multisite = true;
     $this->admin_email = get_blog_option($info->blog_id, 'admin_email');
 }
开发者ID:nitwitt10,项目名称:wp-test,代码行数:30,代码来源:timber-site.php


示例6: wp_check_bind_user

function wp_check_bind_user($username, $password)
{
    if (empty($password)) {
        return __('<strong>ERROR</strong>: The password field is empty.');
    }
    $userdata = get_userdatabylogin($username);
    if (!$userdata) {
        return sprintf(__('<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), site_url('wp-login.php?action=lostpassword', 'login'));
    }
    if (is_multisite()) {
        // Is user marked as spam?
        if (1 == $userdata->spam) {
            return __('<strong>ERROR</strong>: Your account has been marked as a spammer.');
        }
        // Is a user's blog marked as spam?
        if (!is_super_admin($userdata->ID) && isset($userdata->primary_blog)) {
            $details = get_blog_details($userdata->primary_blog);
            if (is_object($details) && $details->spam == 1) {
                return __('Site Suspended.');
            }
        }
    }
    $userdata = apply_filters('wp_authenticate_user', $userdata, $password);
    if (is_wp_error($userdata)) {
        return;
    }
    if (!wp_check_password($password, $userdata->user_pass, $userdata->ID)) {
        return sprintf(__('<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s" title="Password Lost and Found">Lost your password</a>?'), $username, site_url('wp-login.php?action=lostpassword', 'login'));
    }
}
开发者ID:liangwei1988,项目名称:wordpress,代码行数:30,代码来源:signup.php


示例7: run

 /**
  * Start importer background process on production environment.
  */
 public function run()
 {
     // Get current deploy status (if any).
     $deploy_status = $this->api->get_deploy_status($this->batch->get_id());
     // Make sure background import for this job is not already running.
     if ($deploy_status > 0) {
         return;
     }
     // Inicate that background import is about to start.
     $this->api->set_deploy_status($this->batch->get_id(), 1);
     // Default site path.
     $site_path = '/';
     // Site path in multi-site setup.
     if (is_multisite()) {
         $site = get_blog_details();
         $site_path = $site->path;
     }
     // Trigger import script.
     $import_script = dirname(dirname(dirname(__FILE__))) . '/scripts/import-batch.php';
     $background_process = new Background_Process('php ' . $import_script . ' ' . ABSPATH . ' ' . get_site_url() . ' ' . $this->batch->get_id() . ' ' . $site_path . ' ' . $this->api->generate_import_key($this->batch));
     if (file_exists($import_script)) {
         $background_process->run();
     }
     if (!$background_process->get_pid()) {
         // Failed to start background import.
         $this->api->add_deploy_message($this->batch->get_id(), 'Batch import failed to start.', 'info');
         $this->api->set_deploy_status($this->batch->get_id(), 2);
     }
 }
开发者ID:s-cotton,项目名称:content-staging,代码行数:32,代码来源:class-batch-background-importer.php


示例8: get_blog_details

 public function get_blog_details()
 {
     if (is_null($this->blog_details)) {
         $this->blog_details = get_blog_details();
     }
     return $this->blog_details;
 }
开发者ID:sistercylon,项目名称:loverboy-wp-local,代码行数:7,代码来源:Options.php


示例9: framemarket_listall_shops

function framemarket_listall_shops()
{
    global $wpdb;
    $query = "SELECT blog_id FROM " . $wpdb->base_prefix . "blogs WHERE spam != '1' AND archived != '1' AND deleted != '1' AND public = '1' ORDER BY path";
    $blogs = $wpdb->get_results($query);
    $blogs = apply_filters('framemarket_list_shops', $blogs);
    ?>
<select name="shoplist" onchange="document.location.href=this.options[this.selectedIndex].value;">
	<option value=""><?php 
    echo apply_filters('shop_drop_default_label', 'Visit a shop');
    ?>
</option>
	<?php 
    foreach ($blogs as $blog) {
        $blog_details = get_blog_details($blog->blog_id);
        ?>
<option value="<?php 
        echo $blog_details->siteurl;
        ?>
"> <?php 
        echo $blog_details->blogname;
        ?>
</option>
<?php 
    }
    ?>
 </select>
<?php 
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:29,代码来源:marketpress.php


示例10: prepare_items

 public function prepare_items()
 {
     $current_page = $this->get_pagenum();
     $per_page = 10;
     global $blog_id;
     global $wpdb;
     global $pagenow;
     if (is_plugin_active_for_network('wp-piwik/wp-piwik.php')) {
         $total_items = $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->blogs);
         $blogs = \WP_Piwik\Settings::getBlogList($per_page, $current_page);
         foreach ($blogs as $blog) {
             $blogDetails = get_blog_details($blog['blog_id'], true);
             $this->data[] = array('name' => $blogDetails->blogname, 'id' => $blogDetails->blog_id, 'siteurl' => $blogDetails->siteurl, 'piwikid' => $this->wpPiwik->getPiwikSiteId($blogDetails->blog_id));
         }
     } else {
         $blogDetails = get_bloginfo();
         $this->data[] = array('name' => get_bloginfo('name'), 'id' => '-', 'siteurl' => get_bloginfo('url'), 'piwikid' => $this->wpPiwik->getPiwikSiteId());
         $total_items = 1;
     }
     $columns = $this->get_columns();
     $hidden = array();
     $sortable = array();
     $this->_column_headers = array($columns, $hidden, $sortable);
     $this->set_pagination_args(array('total_items' => $total_items, 'per_page' => $per_page));
     foreach ($this->data as $key => $dataset) {
         if (empty($dataset['piwikid']) || $dataset['piwikid'] == 'n/a') {
             $this->data[$key]['piwikid'] = __('Site not created yet.', 'wp-piwik');
         }
         if ($this->wpPiwik->isNetworkMode()) {
             $this->data[$key]['name'] = '<a href="index.php?page=wp-piwik_stats&wpmu_show_stats=' . $dataset['id'] . '">' . $dataset['name'] . '</a>';
         }
     }
     $this->items = $this->data;
     return count($this->items);
 }
开发者ID:DenisMalofeyev,项目名称:WP-Piwik,代码行数:35,代码来源:Sitebrowser.php


示例11: list_network_sites

function list_network_sites($atts)
{
    // Start by getting an array of information of all sites in the network.
    $info = array('network_id' => null, 'public' => null, 'archived' => null, 'mature' => null, 'spam' => null, 'deleted' => null, 'limit' => 100, 'offset' => 0);
    $siteInfos = wp_get_sites($info);
    // Use shortcode atts to determine list type, then begin the output variable $list with the right <li> tag.
    $listType = shortcode_atts(array('list' => "unordered"), $atts);
    if ($listType['list'] == "unordered") {
        $list = "<ul>";
    } else {
        if ($listType['list'] == "ordered") {
            $list = "<ol>";
        } else {
            $list = "Error: Incorrect shortcode was used. Please contact admin.";
            return $list;
        }
    }
    // Add the list content.
    foreach ($siteInfos as $siteInfo) {
        $blog_details = get_blog_details($siteInfo['blog_id']);
        $list .= "<li><a href='{$blog_details->siteurl}'>{$blog_details->blogname}</a></li>";
    }
    // Close the list tag.
    if ($listType['list'] == "unordered") {
        $list .= "</ul>";
    } else {
        $list .= "</ol>";
    }
    return $list;
}
开发者ID:amychan331,项目名称:personalProject-shortcut,代码行数:30,代码来源:list_network_sites.php


示例12: uw_register_widgets

function uw_register_widgets()
{
    if (!is_blog_installed()) {
        return;
    }
    unregister_widget('Widget_Akismet');
    unregister_widget('WP_Widget_Meta');
    unregister_widget('WP_Widget_Recent_Posts');
    unregister_widget('WP_Widget_RSS');
    //register_widget('UW_Widget_Single_Image');
    //register_widget('UW_RSS_Widget');
    //register_widget('UW_Widget_Recent_Posts');
    //register_widget('UW_Widget_CommunityPhotos');
    register_widget('UW_Widget_Categories');
    //register_widget('UW_Widget_Twitter');
    //register_widget('UW_KEXP_KUOW_Widget');
    //register_widget('UW_Showcase_Widget');
    //register_widget('UW_Subpage_Menu');
    register_widget('UW_Nav_Menu_Widget');
    //register_widget('UW_Calendar');
    //register_widget('UW_Campus_Map');
    // Specific to Page Builder only
    register_widget('UW_Headline_Separator_Widget');
    register_widget('UW_Headline_Widget');
    register_widget('UW_Intro_Widget');
    //register_widget('UW_YouTube_Playlist_Widget');
    if (is_multisite() && get_blog_details('marketing')) {
        register_widget('UW_Pride_Points');
    }
}
开发者ID:uw-sop,项目名称:htdocs,代码行数:30,代码来源:custom-widgets.php


示例13: get_dashboard_blog

/**
 * Get the "dashboard blog", the blog where users without a blog edit their profile data.
 * Dashboard blog functionality was removed in WordPress 3.1, replaced by the user admin.
 *
 * @since MU
 * @deprecated 3.1.0
 * @see get_blog_details()
 * @return int
 */
function get_dashboard_blog()
{
    _deprecated_function(__FUNCTION__, '3.1');
    if ($blog = get_site_option('dashboard_blog')) {
        return get_blog_details($blog);
    }
    return get_blog_details($GLOBALS['current_site']->blog_id);
}
开发者ID:cybKIRA,项目名称:roverlink-updated,代码行数:17,代码来源:ms-deprecated.php


示例14: redirectTo

/**
 * Run redirection
 * 
 * @param string $lang		Current language
 * @param string $req		Current path
 * @param array $sites		List of others sites
 */
function redirectTo($lang, $req, &$sites)
{
    if ($req == get_blog_details()->path) {
        header('Location: ' . $sites[$lang]);
    } else {
        header('Location: ' . $sites[$lang] . '404error');
    }
}
开发者ID:Namide,项目名称:Multisite-Language-Switcher-Theme,代码行数:15,代码来源:index.php


示例15: login_site_redirect

function login_site_redirect($redirect_to)
{
    global $user;
    $primary_blog_id = get_usermeta($user->ID, 'primary_blog');
    $blog_details = get_blog_details($primary_blog_id);
    $redirect_url = $blog_details->siteurl;
    return $redirect_url;
}
开发者ID:sburns90,项目名称:WP-MS-Login-Redirector,代码行数:8,代码来源:ms-login-redirector.php


示例16: column_blog_id

 function column_blog_id($item)
 {
     if (!empty($item['blog_id'])) {
         $blog = get_blog_details($item['blog_id']);
         return sprintf('<a href="%s">%s</a>', get_site_url($item['blog_id']), $blog->blogname);
     } else {
         return 'N/A';
     }
 }
开发者ID:lumenlearning,项目名称:candela-lti,代码行数:9,代码来源:candela-lti-table.php


示例17: prepare_item

 private function prepare_item($blog)
 {
     $details = get_blog_details($blog);
     $id = $blog['blog_id'];
     switch_to_blog($id);
     $result = ['id' => $id, 'name' => $details->blogname, 'icon' => get_site_icon_url(), 'path' => $blog['path'], 'description' => get_bloginfo($blog), 'global' => in_array($id, $this->GLOBAL_SITE_IDS)];
     restore_current_blog();
     return $result;
 }
开发者ID:benginoe,项目名称:cms,代码行数:9,代码来源:RestApi_Multisites.php


示例18: prepare_item

 private function prepare_item($blog)
 {
     $details = get_blog_details($blog);
     $id = $blog['blog_id'];
     switch_to_blog($id);
     $result = ['id' => $id, 'name' => $details->blogname, 'icon' => get_site_icon_url(), 'cover_image' => get_header_image(), 'color' => '#FFA000', 'path' => $blog['path'], 'description' => get_bloginfo($blog), 'live' => in_array($id, $this->included_site_ids)];
     restore_current_blog();
     return $result;
 }
开发者ID:elordin,项目名称:cms,代码行数:9,代码来源:RestApi_Multisites.php


示例19: add_site_title_body_class

 function add_site_title_body_class($classes)
 {
     $site = array_filter(explode('/', get_blog_details(get_current_blog_id())->path));
     array_shift($site);
     if (is_multisite()) {
         $classes[] = 'site-' . sanitize_html_class(implode('-', $site));
     }
     return $classes;
 }
开发者ID:ryanwgrant,项目名称:uw-2014,代码行数:9,代码来源:class.filters.php


示例20: set_domain

 /**
  * Set working domain name..
  * @param $the_domain
  * @return $this
  */
 public function set_domain($the_domain = false)
 {
     if ($the_domain == false || preg_match('/^[-a-z0-9]+\\.[a-z]{2,6}$/', strtolower($the_domain)) == false) {
         throw new Youtube_exception('Invalid domain.  Need to define domain and domain must follow the format domain.tld');
     }
     $this->_my_site = get_blog_details(array("domain" => $the_domain));
     switch_to_blog($this->_my_site->blog_id);
     $this->_my_data["categories"] = get_categories(array('orderby' => 'name', 'hide_empty' => 0));
     return $this;
 }
开发者ID:Aranjedeath,项目名称:sitegenerator,代码行数:15,代码来源:lib_youtube.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_blog_id_from_url函数代码示例发布时间:2022-05-15
下一篇:
PHP get_blog_count函数代码示例发布时间: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