当前位置: 首页>>代码示例>>PHP>>正文


PHP delete_blog_option函数代码示例

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


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

示例1: deleteOption

 static function deleteOption($name, $blogID = 1)
 {
     if (wpsIsMultisite()) {
         return delete_blog_option($blogID, $name);
     }
     return delete_option($name);
 }
开发者ID:yarwalker,项目名称:ecobyt,代码行数:7,代码来源:WpsOption.php

示例2: vaa_uninstall

function vaa_uninstall($blog_id = false)
{
    // Delete all View Admin As options
    $option_keys = array('vaa_view_admin_as', 'vaa_role_defaults');
    if ($blog_id) {
        if ($blog_id == 'site') {
            foreach ($option_keys as $option_key) {
                delete_site_option($option_key);
            }
        } else {
            foreach ($option_keys as $option_key) {
                delete_blog_option($blog_id, $option_key);
            }
        }
    } else {
        foreach ($option_keys as $option_key) {
            delete_option($option_key);
        }
        // Delete all View Admin As user metadata
        $user_meta_keys = array('vaa-view-admin-as');
        // Older (not used anymore) keys
        $user_meta_keys[] = 'view-admin-as';
        global $wpdb;
        $all_users = $wpdb->get_results("SELECT ID FROM {$wpdb->users}");
        foreach ($all_users as $user) {
            foreach ($user_meta_keys as $user_meta_key) {
                delete_user_meta($user->ID, $user_meta_key);
            }
        }
    }
}
开发者ID:JoryHogeveen,项目名称:view-admin-as,代码行数:31,代码来源:uninstall.php

示例3: pp_delete_multisite_option

 /** Delete plugin options */
 function pp_delete_multisite_option($blog_id = '')
 {
     // remove uer moderation "pending" role
     remove_role('pending_users');
     delete_blog_option($blog_id, 'pp_settings_data');
     delete_site_option('pp_plugin_lite_activated');
     delete_site_option('pp_version');
     delete_site_option('pp_db_ver');
 }
开发者ID:pawandhillon,项目名称:ICTICT-project,代码行数:10,代码来源:uninstall.php

示例4: popmake_delete_site_option

function popmake_delete_site_option($key)
{
    global $blog_id;
    if (function_exists('is_multisite') && is_multisite() && $blog_id) {
        return delete_blog_option($blog_id, $key);
    } else {
        return delete_site_option($key);
    }
}
开发者ID:webprese,项目名称:dev.mgeonline,代码行数:9,代码来源:general-functions.php

示例5: reset

 public static function reset()
 {
     if (is_multisite()) {
         delete_blog_option(BLOG_ID_CURRENT_SITE, self::$_optionName);
     } else {
         delete_option(self::$_optionName);
     }
     self::setDefault();
 }
开发者ID:themexpand,项目名称:xpand-buddy,代码行数:9,代码来源:Options.php

示例6: delete_duplicable_option

 /**
  * Delete 'mucd_duplicable' option for all sites
  * @since 0.2.0
  */
 public static function delete_duplicable_option()
 {
     $network_blogs = wp_get_sites(array('limit' => MUCD_MAX_NUMBER_OF_SITE));
     foreach ($network_blogs as $blog) {
         $blog_id = $blog['blog_id'];
         delete_blog_option($blog_id, 'mucd_duplicable');
     }
     delete_site_option('mucd_duplicables');
 }
开发者ID:tlandn,项目名称:akvo-sites-zz-template,代码行数:13,代码来源:option.php

示例7: deleteOption

 /**
  * Delete Blog Option
  *
  * @param string $option
  * @param int    $blog_id
  * 
  * @return bool
  *
  * @access public
  * @static
  */
 public static function deleteOption($option, $blog_id = null)
 {
     if (is_multisite()) {
         $blog = is_null($blog_id) ? get_current_blog_id() : $blog_id;
         $response = delete_blog_option($blog, $option);
     } else {
         $response = delete_option($option);
     }
     return $response;
 }
开发者ID:phongvan212,项目名称:tuanh,代码行数:21,代码来源:API.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: 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

示例10: wp_super_cache_blogs_field

function wp_super_cache_blogs_field($name, $blog_id)
{
    if ($name != 'wp_super_cache') {
        return false;
    }
    if (isset($_GET['id']) && $blog_id == $_GET['id']) {
        $valid_nonce = isset($_GET['_wpnonce']) ? wp_verify_nonce($_GET['_wpnonce'], 'wp-cache' . $_GET['id']) : false;
        if ($valid_nonce && isset($_GET['action']) && $_GET['action'] == 'disable_cache') {
            add_blog_option($_GET['id'], 'wp_super_cache_disabled', 1);
        } elseif ($valid_nonce && isset($_GET['action']) && $_GET['action'] == 'enable_cache') {
            delete_blog_option($_GET['id'], 'wp_super_cache_disabled');
        }
    }
    if (get_blog_option($blog_id, 'wp_super_cache_disabled') == 1) {
        echo "<a href='" . wp_nonce_url(add_query_arg(array('action' => 'enable_cache', 'id' => $blog_id)), 'wp-cache' . $blog_id) . "'>" . __('Enable', 'wp-super-cache') . "</a>";
    } else {
        echo "<a href='" . wp_nonce_url(add_query_arg(array('action' => 'disable_cache', 'id' => $blog_id)), 'wp-cache' . $blog_id) . "'>" . __('Disable', 'wp-super-cache') . "</a>";
    }
}
开发者ID:ssaki,项目名称:wp-super-cache,代码行数:19,代码来源:multisite.php

示例11: ocs_uninstall

function ocs_uninstall($blog_id = false)
{
    // Delete all options
    $option_keys = array('off_canvas_sidebars_options');
    if ($blog_id) {
        if ($blog_id == 'site') {
            foreach ($option_keys as $option_key) {
                delete_site_option($option_key);
            }
        } else {
            foreach ($option_keys as $option_key) {
                delete_blog_option($blog_id, $option_key);
            }
        }
    } else {
        foreach ($option_keys as $option_key) {
            delete_option($option_key);
        }
    }
}
开发者ID:JoryHogeveen,项目名称:off-canvas-sidebars,代码行数:20,代码来源:uninstall.php

示例12: create_site_admin_menu_entry

 function create_site_admin_menu_entry()
 {
     if (@$_POST && isset($_POST['option_page']) && 'wdpv' == @$_POST['option_page']) {
         if (isset($_POST['wdpv'])) {
             $this->data->set_options($_POST['wdpv']);
         }
         if (WP_NETWORK_ADMIN && $this->data->get_option('disable_siteadmin_changes')) {
             // Flush per-blog settings
             $blogs = $this->model->get_blog_ids();
             foreach ($blogs as $blog) {
                 delete_blog_option($blog['blog_id'], "wdpv");
             }
         }
         $goback = add_query_arg('settings-updated', 'true', wp_get_referer());
         wp_redirect($goback);
         die;
     }
     add_submenu_page('settings.php', 'Post Voting', 'Post Voting', 'manage_network_options', 'wdpv', array($this, 'create_admin_page'));
     add_dashboard_page('Voting Stats', 'Voting Stats', 'manage_network_options', 'wdpv_stats', array($this, 'create_stats_page'));
 }
开发者ID:hscale,项目名称:webento,代码行数:20,代码来源:class_wdpv_admin_pages.php

示例13: import_site_relations

 /**
  * Move site relationships from separate options to network table.
  *
  * @return void
  */
 private function import_site_relations()
 {
     /** @var Mlp_Site_Relations_Interface $db */
     $relations = $this->plugin_data->get('site_relations');
     $option_name = 'inpsyde_multilingual_blog_relationship';
     $inserted = 0;
     foreach ($this->all_sites as $site) {
         $linked = get_blog_option($site['blog_id'], $option_name, array());
         if (!empty($linked)) {
             $inserted += $relations->set_relation($site['blog_id'], $linked);
         }
         delete_blog_option($site['blog_id'], $option_name);
     }
 }
开发者ID:luisarn,项目名称:multilingual-press,代码行数:19,代码来源:Mlp_Update_Plugin_Data.php

示例14: pressbooks_publisher_update_catalog

function pressbooks_publisher_update_catalog()
{
    $blog_id = absint($_POST['book_id']);
    $in_catalog = $_POST['in_catalog'];
    if (current_user_can('manage_network') && check_ajax_referer('pressbooks-publisher-admin')) {
        if ($in_catalog == 'true') {
            update_blog_option($blog_id, 'pressbooks_publisher_in_catalog', 1);
        } else {
            delete_blog_option($blog_id, 'pressbooks_publisher_in_catalog');
        }
    }
}
开发者ID:cumi,项目名称:pressbooks,代码行数:12,代码来源:functions.php

示例15: bp_delete_option

/**
 * Delete an option.
 *
 * This is a wrapper for {@link delete_blog_option()}, which in turn deletes
 * settings data (such as bp-pages) on the appropriate blog, given your current
 * setup.
 *
 * @since BuddyPress (1.5.0)
 *
 * @uses bp_get_root_blog_id()
 *
 * @param string $option_name The option key to be deleted.
 * @return bool True on success, false on failure.
 */
function bp_delete_option($option_name)
{
    return delete_blog_option(bp_get_root_blog_id(), $option_name);
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:18,代码来源:bp-core-options.php


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