本文整理汇总了PHP中get_blog_option函数的典型用法代码示例。如果您正苦于以下问题:PHP get_blog_option函数的具体用法?PHP get_blog_option怎么用?PHP get_blog_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_blog_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: bp_gallery_get_template_cssjs_dir_url
function bp_gallery_get_template_cssjs_dir_url(){
$theme_dir="";
$stylesheet_dir="";
global $bp,$current_blog;
if(is_multisite()&&$current_blog->blog_id!=BP_ROOT_BLOG){
//find the stylesheet path and
$stylesheet = get_blog_option(BP_ROOT_BLOG,'stylesheet');
$theme_root = get_theme_root( $stylesheet );
$stylesheet_dir = "$theme_root/$stylesheet";
$template=get_blog_option(BP_ROOT_BLOG,'template');
$theme_root = get_theme_root( $template );
$template_dir = "$theme_root/$template";
$theme_root_uri = get_theme_root_uri( $stylesheet );
$stylesheet_dir_uri = "$theme_root_uri/$stylesheet";
$theme_root_uri = get_theme_root_uri( $template );
$template_dir_uri = "$theme_root_uri/$template";
}
else{
$stylesheet_dir=STYLESHEETPATH;
$template_dir=TEMPLATEPATH;
$stylesheet_dir_uri=get_stylesheet_directory_uri();
$template_dir_uri=get_template_directory_uri();
}
if ( file_exists( $stylesheet_dir. '/gallery/inc'))
$theme_uri=$stylesheet_dir_uri;//child theme
else if ( file_exists( $template_dir. '/gallery/inc') )
$theme_uri=$template_dir_uri;//parent theme
if($theme_uri)
return $theme_uri."/gallery";
return false;////template is not present in the active theme/child theme
}
示例3: change
/**
* Change the label of the blog
*/
function change($blogs)
{
if (0 == count($blogs)) {
return $blogs;
}
foreach ($blogs as &$blog) {
$hash = md5(time());
if ($hash === get_blog_option($blog->userblog_id, 'admin_label', $hash)) {
/**
* Allow superadmins to setup an admin label
*/
switch_to_blog($blog->userblog_id);
update_option('admin_label', '');
restore_current_blog();
} else {
if ($admin_label = get_blog_option($blog->userblog_id, 'admin_label')) {
/**
* Set the admin label
*/
$blog->blogname = $admin_label;
}
}
}
return $blogs;
}
示例4: _sitemap_xpress
function _sitemap_xpress($mydirname)
{
global $sitemap_configs, $xoopsDB;
if (!file_exists(XOOPS_ROOT_PATH . '/modules/' . $mydirname . '/wp-includes/version.php')) {
return '';
}
include XOOPS_ROOT_PATH . '/modules/' . $mydirname . '/wp-includes/version.php';
if ($wp_db_version < 6124) {
// UNDER WP2.3
$block = sitemap_get_categoires_map($xoopsDB->prefix("wp_categories"), "cat_ID", "category_parent", "cat_name", "index.php?cat=", "cat_name");
return $block;
}
$disp_sub = @$sitemap_configs["show_subcategoris"];
$prefix = preg_replace('/wordpress/', 'wp', $mydirname);
$prefix = $xoopsDB->prefix($prefix);
require_once XOOPS_ROOT_PATH . '/modules/' . $mydirname . '/include/general_functions.php';
$options_tables = get_table_list($prefix, 'options');
$index = 0;
$blogs = array();
foreach ($options_tables as $options_table) {
$blog_url = get_blog_option($options_table, 'siteurl');
$blog_sub_url = preg_replace('/.*\\/' . $mydirname . '/', '', $blog_url);
$blog_sub_url = preg_replace('/\\//', '', $blog_sub_url);
if (!empty($blog_sub_url)) {
$blog_sub_url = $blog_sub_url . '/';
}
$blog_name = get_blog_option($options_table, 'blogname');
$db_prefix = get_multi_prefix($options_table, 'options');
$data = array('blog_name' => $blog_name, 'blog_sub_url' => $blog_sub_url, 'term_taxonomy' => $db_prefix . 'term_taxonomy', 'terms' => $db_prefix . 'terms');
$blogs[$index] = $data;
$index++;
}
return xpress_get_categoires_map($blogs, $disp_sub);
}
示例5: activation_column
/**
* Shows the redirect status in the sites list.
*
* @return void
*/
private function activation_column()
{
(new SitesListTableColumn('multilingualpress.redirect', __('Redirect', 'multilingual-press'), function ($id, $site_id) {
// TODO: Don't hard-code option name.
return get_blog_option($site_id, 'inpsyde_multilingual_redirect') ? '<span class="dashicons dashicons-yes"></span>' : '';
}))->register();
}
示例6: widget
function widget($args, $instance)
{
global $post;
Protect();
extract($args, EXTR_SKIP);
echo $before_widget;
$title = empty($instance['title']) ? __('Hosted Site List', 'comicpress') : apply_filters('widget_title', $instance['title']);
if (!empty($title)) {
echo $before_title . $title . $after_title;
}
$blogs = get_last_updated();
if (is_array($blogs)) {
?>
<ul>
<?php
foreach ($blogs as $details) {
?>
<li><a href="http://<?php
echo $details['domain'] . $details['path'];
?>
"><?php
echo get_blog_option($details['blog_id'], 'blogname');
?>
</a></li>
<?php
}
?>
</ul>
<?php
}
echo $after_widget;
UnProtect();
}
示例7: jetpack_site_icon_url
function jetpack_site_icon_url($blog_id = null, $size = '512', $default = false)
{
$url = '';
if (!is_int($blog_id)) {
$blog_id = get_current_blog_id();
}
if (function_exists('get_blog_option')) {
$site_icon_id = get_blog_option($blog_id, 'jetpack_site_icon_id');
} else {
$site_icon_id = Jetpack_Options::get_option('site_icon_id');
}
if (!$site_icon_id) {
if ($default === false && defined('SITE_ICON_DEFAULT_URL')) {
$url = SITE_ICON_DEFAULT_URL;
} else {
$url = $default;
}
} else {
if ($size >= 512) {
$size_data = 'full';
} else {
$size_data = array($size, $size);
}
$url_data = wp_get_attachment_image_src($site_icon_id, $size_data);
$url = $url_data[0];
}
return $url;
}
示例8: bp_gtm_email_notify
function bp_gtm_email_notify()
{
global $bp;
// Get user data
$reciever_name = bp_core_get_user_displayname($_GET['resp_id'], false);
$reciever_ud = get_userdata($_GET['resp_id']);
$sender_name = bp_core_get_user_displayname($bp->loggedin_user->id, false);
$sender_link = bp_core_get_userlink($bp->loggedin_user->id, false, true);
// Lunks to use in email
$reciever_personal_tasks_link = site_url(BP_MEMBERS_SLUG . '/' . $reciever_ud->user_login . '/' . $bp->gtm->slug . '/tasks');
$reciever_personal_projects_link = site_url(BP_MEMBERS_SLUG . '/' . $reciever_ud->user_login . '/' . $bp->gtm->slug . '/projects');
/* Set up and send the message */
$to = $reciever_ud->user_email;
$subject = get_blog_option(1, 'blogname') . ': ' . __('Assignments');
$message = sprintf(__('Hello there %s,
%s (%s) reminds you, that pending tasks and projects you are responsible for need to be done.
To see your personal tasks click here: %s
To see your personal projects click here: %s
---------------------
%s. %s
', 'bp_gtm'), $reciever_name, $sender_name, $sender_link, $reciever_personal_tasks_link, $reciever_personal_projects_link, get_blog_option(1, 'blogname'), get_blog_option(1, 'blogdescription'));
// Send it!
wp_mail($to, $subject, $message);
echo 'sent!';
}
示例9: 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'];
}
示例10: test_bp_core_ajax_url
function test_bp_core_ajax_url()
{
$forced = force_ssl_admin();
// (1) HTTPS off
force_ssl_admin(false);
$_SERVER['HTTPS'] = 'off';
// (1a) Front-end
$this->go_to('/');
$this->assertEquals(bp_core_ajax_url(), get_site_url(bp_get_root_blog_id(), '/wp-admin/admin-ajax.php', 'http'));
// (1b) Dashboard
$this->go_to('/wp-admin');
$this->assertEquals(bp_core_ajax_url(), get_site_url(bp_get_root_blog_id(), '/wp-admin/admin-ajax.php', 'http'));
// (2) FORCE_SSL_ADMIN
force_ssl_admin(true);
// (2a) Front-end
$this->go_to('/');
$this->assertEquals(bp_core_ajax_url(), get_site_url(bp_get_root_blog_id(), '/wp-admin/admin-ajax.php', 'http'));
// (2b) Dashboard
$this->go_to('/wp-admin');
$this->assertEquals(bp_core_ajax_url(), get_site_url(bp_get_root_blog_id(), '/wp-admin/admin-ajax.php', 'https'));
force_ssl_admin($forced);
// (3) Multisite, root blog other than 1
if (is_multisite()) {
$original_root_blog = bp_get_root_blog_id();
$blog_id = $this->factory->blog->create(array('path' => '/path' . rand() . time() . '/'));
buddypress()->root_blog_id = $blog_id;
$blog_url = get_blog_option($blog_id, 'siteurl');
$this->go_to(trailingslashit($blog_url));
buddypress()->root_blog_id = $original_root_blog;
$ajax_url = bp_core_ajax_url();
$this->go_to('/');
$this->assertEquals($blog_url . '/wp-admin/admin-ajax.php', $ajax_url);
}
}
示例11: friends_notification_accepted_request
function friends_notification_accepted_request($friendship_id, $initiator_id, $friend_id)
{
global $bp;
$friendship = new BP_Friends_Friendship($friendship_id, false, false);
$friend_name = bp_fetch_user_fullname($friend_id, false);
if ('no' == get_usermeta((int) $initiator_id, 'notification_friends_friendship_accepted')) {
return false;
}
$ud = get_userdata($initiator_id);
$friend_ud = get_userdata($friend_id);
$friend_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $friend_ud->user_login;
$settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';
// Set up and send the message
$to = $ud->user_email;
$subject = '[' . get_blog_option(1, 'blogname') . '] ' . sprintf(__('%s accepted your friendship request', 'buddypress'), $friend_name);
$message = sprintf(__('%s accepted your friend request.
To view %s\'s profile: %s
---------------------
', 'buddypress'), $friend_name, $friend_name, $friend_link);
$message .= sprintf(__('To disable these notifications please log in and go to: %s', 'buddypress'), $settings_link);
// Send it
wp_mail($to, $subject, $message);
}
示例12: getOption
static function getOption($name, $default = false, $blogID = 1)
{
if (wpsIsMultisite()) {
return get_blog_option($blogID, $name, $default);
}
return get_option($name, $default);
}
示例13: include_professors
function include_professors()
{
$admin_id = get_user_id_from_string(get_blog_option($current_blog->blog_id, 'admin_email'));
$blog_major = get_user_major();
//get_the_user_major($admin_id);
//var_dump($blog_major);
if ($GLOBALS['blog_id'] != 1) {
//makes sure it's not the root blog
$args = array('blog_id' => 1, 'role' => 'professor');
$professors = get_users($args);
//get all profs from root blog
//loop through profs, add as user if same major, delete if different major
foreach ($professors as $professor) {
$prof_major = get_the_user_major($professor->ID);
//var_dump($prof_major);
if ($prof_major == $blog_major) {
$current_role = get_the_user_role($professor);
if ($current_role != 'Administrator') {
$result = add_existing_user_to_blog(array('user_id' => $professor->ID, 'role' => 'professor'));
}
} else {
$result = remove_user_from_blog($professor->ID, $current_blog->blog_id);
}
}
}
//end if
}
示例14: widget
function widget($args, $instance)
{
global $wpdb;
$data['blogs'] = $wpdb->get_results($wpdb->prepare("\n\t\t\tSELECT blog_id, domain, path \n\t\t\tFROM {$wpdb->blogs} \n\t\t\tWHERE \n\t\t\t\tpublic = '1' AND \n\t\t\t\tarchived = '0' AND \n\t\t\t\tmature = '0' AND \n\t\t\t\tspam = '0' AND \n\t\t\t\tdeleted = '0' \n\t\t\tORDER BY blog_id ASC"), ARRAY_A);
foreach ($data['blogs'] as $index => $blog) {
$name = get_blog_option($blog['blog_id'], 'blogname');
switch ($name) {
case 'Namics Weblog':
$name = 'Blog';
break;
case 'Namics.Lab':
$name = 'Lab';
break;
case 'Namics SharePoint Weblog':
$name = 'SharePoint';
break;
case 'Hirnlego':
$name = 'Hirnlego';
break;
case 'about:Namics':
$name = 'About';
break;
}
$data['blogs'][$index]['name'] = $name;
}
if (sizeof($data['blogs']) > 0) {
$this->display($instance, $data);
}
}
示例15: render_cell
/**
* Render cell content.
*
* @param string $column_name Not used, but passed.
* @param int $blog_id
* @return string
*/
public function render_cell($column_name, $blog_id)
{
if (!get_blog_option($blog_id, 'inpsyde_multilingual_redirect')) {
return '';
}
return "<img src='{$this->image_url}' alt='x'>";
}