本文整理汇总了PHP中update_blog_option函数的典型用法代码示例。如果您正苦于以下问题:PHP update_blog_option函数的具体用法?PHP update_blog_option怎么用?PHP update_blog_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了update_blog_option函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: updateOption
static function updateOption($name, $value, $blogID = 1)
{
if (wpsIsMultisite()) {
return update_blog_option($blogID, $name, $value);
}
return update_option($name, $value);
}
开发者ID:yarwalker,项目名称:ecobyt,代码行数:7,代码来源:WpsOption.php
示例2: update_flag
/**
* Updates flag url for given blog.
*
* @param int $blog_id
* @param string $flag_url
*
* @return bool
*/
public static function update_flag($blog_id, $flag_url)
{
$flag_url = empty($flag_url) ? '' : $flag_url;
if ($blog_id > 0) {
return update_blog_option($blog_id, 'inpsyde_multilingual_flag_url', $flag_url);
}
return FALSE;
}
开发者ID:JonZiemlich,项目名称:wpml2mlp,代码行数:16,代码来源:Wpml2mlp_Helper.php
示例3: save
/**
* Validate and save user input
*
* @param array $data User input
* @return bool
*/
public function save(array $data)
{
if (!$this->nonce->is_valid()) {
return false;
}
$id = $this->get_current_blog_id($data, get_current_blog_id());
$value = $this->get_sent_value($data);
return update_blog_option($id, $this->option_name, $value);
}
开发者ID:inpsyde,项目名称:multilingual-press,代码行数:15,代码来源:Mlp_Redirect_Settings_Data.php
示例4: popmake_update_site_option
function popmake_update_site_option($key, $value)
{
global $blog_id;
if (function_exists('is_multisite') && is_multisite() && $blog_id) {
return update_blog_option($blog_id, $key, $value);
} else {
return update_site_option($key, $value);
}
}
开发者ID:webprese,项目名称:dev.mgeonline,代码行数:9,代码来源:general-functions.php
示例5: updateOption
/**
* Update Blog Option
*
* @param string $option
* @param mixed $data
* @param int $blog_id
*
* @return bool
*
* @access public
* @static
*/
public static function updateOption($option, $data, $blog_id = null)
{
if (is_multisite()) {
$blog = is_null($blog_id) ? get_current_blog_id() : $blog_id;
$response = update_blog_option($blog, $option, $data);
} else {
$response = update_option($option, $data);
}
return $response;
}
开发者ID:phongvan212,项目名称:tuanh,代码行数:22,代码来源:API.php
示例6: setOptions
/**
* @param array $options
* @param int $blog ID of the blog to be set in multisite env.
*/
public static function setOptions($options, $blog = null)
{
if (is_null($blog)) {
global $dg_options;
update_option(DG_OPTION_NAME, $options);
$dg_options = $options;
} else {
update_blog_option($blog, DG_OPTION_NAME, $options);
}
}
开发者ID:githubhelp,项目名称:document-gallery,代码行数:14,代码来源:class-document-gallery.php
示例7: update_test_options
/**
* A wrapper for updating theme options on the test install
*
* @param string $option_name The option name
* @param array The options array to update
* @return bool True on success, false on failure.
*/
function update_test_options($option_name, $options_array)
{
if (defined('WP_TESTS_MULTISITE') && WP_TESTS_MULTISITE) {
global $blog_id;
$options = update_blog_option($blog_id, $option_name, $options_array);
} else {
$options = update_option($option_name, $options_array);
}
return $options;
}
开发者ID:SeamlessThemes,项目名称:seamless,代码行数:17,代码来源:test-thematic.php
示例8: mytheme_add_admin
function mytheme_add_admin()
{
global $themename, $shortname, $options, $blog_id;
$page = '';
if (isset($_GET["page"]) && !empty($_GET["page"])) {
$page = $_GET["page"];
}
if ($page == basename(__FILE__)) {
$action = '';
if (isset($_REQUEST["action"]) && !empty($_REQUEST["action"])) {
$action = $_REQUEST["action"];
}
if ('save' == $action) {
check_admin_referer('thematic-theme-options');
foreach ($options as $value) {
if (THEMATIC_MB) {
if (isset($_REQUEST[$value['id']])) {
update_blog_option($blog_id, $value['id'], $_REQUEST[$value['id']]);
} else {
update_blog_option($blog_id, $value['id'], $value['std']);
}
} else {
if (isset($_REQUEST[$value['id']])) {
update_option($value['id'], $_REQUEST[$value['id']]);
} else {
update_option($value['id'], $value['std']);
}
}
}
header("Location: themes.php?page=theme-options.php&saved=true");
die;
} else {
if ('reset' == $action) {
check_admin_referer('thematic-reset');
foreach ($options as $value) {
if (THEMATIC_MB) {
delete_blog_option($blog_id, $value['id']);
} else {
delete_option($value['id']);
}
}
header("Location: themes.php?page=theme-options.php&reset=true");
die;
} else {
if ('resetwidgets' == $action) {
check_admin_referer('thematic-reset-widgets');
update_option('sidebars_widgets', NULL);
header("Location: themes.php?page=theme-options.php&resetwidgets=true");
die;
}
}
}
}
add_theme_page($themename . " Options", "Thematic Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');
}
开发者ID:StudentLifeMarketingAndDesign,项目名称:krui-wp,代码行数:55,代码来源:theme-options.php
示例9: set_duplicable_option
/**
* Set 'mucd_duplicable' option to "yes" for the list of blogs, other to "no"
* @since 0.2.0
* @param array $blogs list of blogs we want the option set to "yes"
*/
public static function set_duplicable_option($blogs)
{
$network_blogs = wp_get_sites(array('limit' => MUCD_MAX_NUMBER_OF_SITE));
foreach ($network_blogs as $blog) {
if (in_array($blog['blog_id'], $blogs)) {
update_blog_option($blog['blog_id'], 'mucd_duplicable', "yes");
} else {
update_blog_option($blog['blog_id'], 'mucd_duplicable', "no");
}
}
}
开发者ID:tlandn,项目名称:akvo-sites-zz-template,代码行数:16,代码来源:option.php
示例10: login_radius_update_old_blogs
public function login_radius_update_old_blogs($oldConfig)
{
global $loginradius_api_settings;
if (isset($loginradius_api_settings['multisite_config']) && $loginradius_api_settings['multisite_config'] == '1') {
$settings = get_option('LoginRadius_share_settings');
$blogs = wp_get_sites();
foreach ($blogs as $blog) {
update_blog_option($blog['blog_id'], 'LoginRadius_share_settings', $settings);
}
}
}
开发者ID:selectSIFISO,项目名称:.comsite,代码行数:11,代码来源:lr-social-share-admin.php
示例11: oss_update_old_blogs
public function oss_update_old_blogs($oldConfig)
{
global $oss_api_settings;
if (isset($oss_api_settings['multisite_config']) && $oss_api_settings['multisite_config'] == '1') {
$settings = get_option('OpenSocialShare_share_settings');
$blogs = wp_get_sites();
foreach ($blogs as $blog) {
update_blog_option($blog['blog_id'], 'OpenSocialShare_share_settings', $settings);
}
}
}
开发者ID:selectSIFISO,项目名称:.comsite,代码行数:11,代码来源:open-social-share-admin.php
示例12: updateAddress
public static function updateAddress($optionsToUpdate)
{
$countAddress = 1;
while (isset($optionsToUpdate['_gmsites_address' . $countAddress])) {
if ($countAddress <= GMSITES_PERSISTENCE_LIMIT) {
$key = '_gmsites_address' . $countAddress;
$value = $optionsToUpdate['_gmsites_address' . $countAddress];
update_blog_option(self::getBlogID(), $key, $value);
$countAddress++;
}
}
}
开发者ID:androrim,项目名称:googlemaps-sites,代码行数:12,代码来源:class.siteoption.php
示例13: _archivesCalendar_activate
function _archivesCalendar_activate()
{
global $wpdb;
$default_options = array("css" => 1, "theme" => "calendrier", "js" => 1, "show_settings" => 1, "filter" => 0, "javascript" => "jQuery(document).ready(function(\$){\n\t\$('.calendar-archives').archivesCW();\n});");
$default_custom_css = file_get_contents(plugins_url('/admin/default_custom.css', __FILE__));
$default_themer_options = array("arw-theme1" => $default_custom_css, "arw-theme2" => '');
if (!($options = get_option('archivesCalendar'))) {
// if new installation copy default options into the DB
$options = $default_options;
} else {
// if reactivation or after update: merge existing settings with the defaults in case if new options were added in the update
array_merge($default_options, $options);
}
if (!($themer_options = get_option('archivesCalendarThemer'))) {
$themer_options = $default_themer_options;
}
foreach ($themer_options as $ctheme => $css) {
if ($css) {
if (is_writable('../wp-content/plugins/' . dirname(plugin_basename(__FILE__)) . '/themes/')) {
if (isMU()) {
$old_blog = $wpdb->blogid;
$blogids = $wpdb->get_results("SELECT blog_id FROM {$wpdb->blogs}");
foreach ($blogids as $blogid) {
$blog_id = $blogid->blog_id;
switch_to_blog($blog_id);
$filename = '../wp-content/plugins/' . dirname(plugin_basename(__FILE__)) . '/themes/' . $ctheme . '-' . $wpdb->blogid . '.css';
$themefile = fopen($filename, "w") or die("Unable to open file!");
fwrite($themefile, $css);
fclose($themefile);
}
switch_to_blog($old_blog);
} else {
$filename = '../wp-content/plugins/' . dirname(plugin_basename(__FILE__)) . '/themes/' . $ctheme . '.css';
$themefile = fopen($filename, "w") or die("Unable to open file!");
fwrite($themefile, $css);
fclose($themefile);
}
} else {
echo "<p>Can't write in `/wp-content/plugins/" . dirname(plugin_basename(__FILE__)) . "/themes/" . " </p>";
}
}
}
if (isMU()) {
update_blog_option($wpdb->blogid, 'archivesCalendar', $options);
add_blog_option($wpdb->blogid, 'archivesCalendar', $options);
add_blog_option($wpdb->blogid, 'archivesCalendarThemer', $themer_options);
} else {
update_option('archivesCalendar', $options);
add_option('archivesCalendar', $options);
add_option('archivesCalendarThemer', $themer_options);
}
}
开发者ID:durichitayat,项目名称:befolio-wp,代码行数:52,代码来源:arw-install.php
示例14: registerActivationHook
/**
* Activation hook
*
* @see register_activation_hook()
*/
function registerActivationHook()
{
// Prevent overwriting customizations if Pressbooks has been disabled
if (!get_site_option('pressbooks-activated')) {
// Insert Pressbooks description on root blog
update_blog_option(1, 'blogdescription', 'Simple Book Publishing');
// Configure theme and remove widgets from root blog
update_blog_option(1, 'template', 'pressbooks-publisher');
update_blog_option(1, 'stylesheet', 'pressbooks-publisher');
delete_blog_option(1, 'sidebars_widgets');
// Add "activated" key to enable check above
add_site_option('pressbooks-activated', true);
}
}
开发者ID:pressbooks,项目名称:pressbooks,代码行数:19,代码来源:class-pb-activation.php
示例15: bfox_bp_option_sanitize
/**
* Sanitize the BP options
*
* We don't want to save BP options to any blog other than the BP_ROOT_BLOG
*
* @param string $new_value
* @param mixed $option
* @return string $new_value
*/
function bfox_bp_option_sanitize($new_value, $option = '')
{
global $blog_id;
// We don't want to save BP options to any blog other than the BP_ROOT_BLOG
if (BP_ROOT_BLOG != $blog_id) {
if (!$option) {
$option = substr(current_filter(), strlen('sanitize_option_'));
}
// Save the option to the BP_ROOT_BLOG
update_blog_option(BP_ROOT_BLOG, $option, $new_value);
// Since we really want to save to the BP_ROOT_BLOG, let's not change the value in this blog
$new_value = get_option($option);
}
return $new_value;
}
开发者ID:jeffryevans,项目名称:biblefox-wp,代码行数:24,代码来源:biblefox-bp.php
示例16: set
public static function set($_options)
{
if (is_multisite()) {
if (!@get_blog_option(BLOG_ID_CURRENT_SITE, self::$_optionName)) {
add_blog_option(BLOG_ID_CURRENT_SITE, self::$_optionName, $_options);
} else {
update_blog_option(BLOG_ID_CURRENT_SITE, self::$_optionName, $_options + @get_blog_option(BLOG_ID_CURRENT_SITE, self::$_optionName));
}
self::$_arrSettings = @get_blog_option(BLOG_ID_CURRENT_SITE, self::$_optionName);
} else {
if (!@get_option(self::$_optionName)) {
add_option(self::$_optionName, $_options);
} else {
update_option(self::$_optionName, $_options + @get_option(self::$_optionName));
}
self::$_arrSettings = @get_option(self::$_optionName);
}
}
开发者ID:themexpand,项目名称:xpand-buddy,代码行数:18,代码来源:Options.php
示例17: add_new_blog_field
/**
* Add new option when registering a site (back and front end)
*
* URI: http://stackoverflow.com/a/10372861/1287812
*/
public function add_new_blog_field($blog_id, $user_id, $domain, $path, $site_id, $meta)
{
$new_field_value = '';
# Site added in the back end
if (!empty($_POST['blog']['input_site_cat'])) {
switch_to_blog($blog_id);
$cat_id = $_POST['blog']['input_site_cat'];
# TODO: if Sign-up is to be enabled, change this to a method
$val = B5F_Multisite_Categories::get_instance()->do_mature_to_name($cat_id);
update_blog_option($blog_id, 'site_category', $val);
update_blog_status($blog_id, 'mature', $cat_id);
get_blog_status($blog_id, 'mature');
restore_current_blog();
} elseif (!empty($meta['input_site_cat'])) {
$new_field_value = $meta['input_site_cat'];
update_option('site_category', $new_field_value);
}
}
开发者ID:andy218,项目名称:multisite-site-category,代码行数:23,代码来源:class-sites-categories-signup.php
示例18: psu_signup_blog_notification
function psu_signup_blog_notification($domain, $path, $title, $user, $user_email, $key, $meta)
{
$activated = wpmu_activate_signup($key);
if (is_array($activated) && $activated['blog_id'] && $activated['user_id']) {
// successfully created blog
update_blog_option($activated['blog_id'], 'stylesheet', 'pressrow');
update_blog_option($activated['blog_id'], 'template', 'pressrow');
// they're already CAS authenticated,
// so set the WP authentication cookie for them
wp_set_auth_cookie($activated['user_id']);
?>
<h2>Yay! We made a blog for you</h2>
<p>Click this link to access your dashboard:</p>
<ul><li><a href="http://<?php
echo $domain . $path;
?>
wp-admin/"><?php
echo $domain . $path;
?>
wp-admin/</a></li></ul>
<p>Go ahead and bookmark it once you get there, we hope you come back.</p><?php
} else {
// error will robinson
?>
<h2>hrrm...</h2>
<p>There seems to have been an error.</p>
<p>You may already have a blog at this address: <a href="http://<?php
echo $domain . $path;
?>
" target="_blank"><?php
echo $domain . $path;
?>
</a>.</p>
<p>Please call the <a href="http://url.path.to/your/helpdesk" target="_blank">Help Desk</a> with the following:</p>
<p><pre><?php
print_r($activated->errors);
?>
</pre></p><?php
}
return FALSE;
}
开发者ID:syntagma,项目名称:wpcas,代码行数:42,代码来源:provisioning_example.php
示例19: bp_zoneideas_widget_cool_widget_control
/**
* bp_zoneideas_widget_cool_widget_control()
*
* This function will enable a "edit" menu on your widget. This lets site admins click
* the edit link on the widget to set options. The options you can then use in the display of
* your widget.
*
* For zoneideas, in the groups component widget there is a setting called "max-groups" where
* a user can define how many groups they would like to display.
*/
function bp_zoneideas_widget_cool_widget_control()
{
global $current_blog;
$options = $newoptions = get_blog_option($current_blog->blog_id, 'bp_zoneideas_widget_cool_widget');
if ($_POST['bp-zoneideas-widget-cool-widget']) {
$newoptions['option_name'] = strip_tags(stripslashes($_POST['bp-zoneideas-widget-cool-widget-option']));
}
if ($options != $newoptions) {
$options = $newoptions;
update_blog_option($current_blog->blog_id, 'bp_zoneideas_widget_cool_widget', $options);
}
$option_name = attribute_escape($options['option_name']);
?>
<p><label for="bp-zoneideas-widget-cool-widget-option"><?php
_e('Some Option', 'bp-zoneideas');
?>
<br /> <input class="widefat" id="bp-zoneideas-widget-cool-widget-option" name="bp-zoneideas-widget-cool-widget-option" type="text" value="<?php
echo $option_name;
?>
" style="width: 30%" /></label></p>
<input type="hidden" id="bp-zoneideas-widget-cool-widget" name="bp-zoneideas-widget-cool-widget" value="1" />
<?php
}
开发者ID:BGCX261,项目名称:zoneideas-svn-to-git,代码行数:33,代码来源:bp-zoneideas-widgets.php
示例20: affiliate_supporter_paid
function affiliate_supporter_paid($bid, $amount, $supporterperiod)
{
if (function_exists('get_site_option')) {
$getoption = 'get_site_option';
} else {
$getoption = 'get_option';
}
// Check if the blog is from an affiliate
if (function_exists('get_blog_option')) {
$aff = get_blog_option($bid, 'affiliate_referred_by', false);
$paid = get_blog_option($bid, 'affiliate_paid', 'no');
} else {
$aff = false;
}
if ($aff && $paid != 'yes') {
switch ($supporterperiod) {
case '1':
$amount = $getoption("supporter_1_whole_payment", 0) . '.' . $getoption("supporter_1_partial_payment", 0);
break;
case '3':
$amount = $getoption("supporter_3_whole_payment", 0) . '.' . $getoption("supporter_3_partial_payment", 0);
break;
case '12':
$amount = $getoption("supporter_12_whole_payment", 0) . '.' . $getoption("supporter_12_partial_payment", 0);
break;
default:
$amount = 0;
break;
}
do_action('affiliate_purchase', $aff, $amount);
if (defined('AFFILIATE_PAYONCE') && AFFILIATE_PAYONCE == 'yes') {
if (function_exists('update_blog_option')) {
update_blog_option($bid, 'affiliate_paid', 'yes');
}
}
}
}
开发者ID:hscale,项目名称:webento,代码行数:37,代码来源:prosites.php
注:本文中的update_blog_option函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论