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

PHP get_site_option函数代码示例

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

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



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

示例1: seatt_update_db_check

function seatt_update_db_check()
{
    global $seatt_db_version;
    if (get_site_option('seatt_db_version') != $seatt_db_version) {
        seatt_install();
    }
}
开发者ID:sourcez,项目名称:SEATT,代码行数:7,代码来源:simple-events-attendance.php


示例2: bp_wire_posts_template

 function bp_wire_posts_template($item_id, $component_slug, $can_post, $per_page, $max)
 {
     global $bp;
     if ($bp->current_component == $bp->wire->slug) {
         $this->table_name = $bp->profile->table_name_wire;
         // If the user is viewing their own wire, delete the notifications.
         if ('all-posts' == $bp->current_action && bp_is_home()) {
             bp_core_delete_notifications_for_user_by_type($bp->loggedin_user->id, 'xprofile', 'new_wire_post');
         }
     } else {
         $this->table_name = $bp->{$component_slug}->table_name_wire;
     }
     $this->pag_page = isset($_REQUEST['wpage']) ? intval($_REQUEST['wpage']) : 1;
     $this->pag_num = isset($_REQUEST['num']) ? intval($_REQUEST['num']) : $per_page;
     $this->wire_posts = BP_Wire_Post::get_all_for_item($item_id, $this->table_name, $this->pag_page, $this->pag_num);
     $this->total_wire_post_count = (int) $this->wire_posts['count'];
     $this->wire_posts = $this->wire_posts['wire_posts'];
     $this->wire_post_count = count($this->wire_posts);
     if ((int) get_site_option('non-friend-wire-posting') && ($bp->current_component == $bp->profile->slug || $bp->current_component == $bp->wire->slug)) {
         $this->can_post = 1;
     } else {
         $this->can_post = $can_post;
     }
     $this->pag_links = paginate_links(array('base' => add_query_arg('wpage', '%#%', $bp->displayed_user->domain), 'format' => '', 'total' => ceil($this->total_wire_post_count / $this->pag_num), 'current' => $this->pag_page, 'prev_text' => '«', 'next_text' => '»', 'mid_size' => 1));
 }
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:25,代码来源:bp-wire-templatetags.php


示例3: _initHooks

 protected function _initHooks()
 {
     add_action('admin_init', array($this, 'admin_init'), 20);
     add_action('admin_menu', array($this, 'admin_menu'));
     add_action('network_admin_menu', array($this, 'network_admin_menu'));
     add_action('admin_head', array($this, 'admin_head'));
     add_action('wp_dashboard_setup', array($this, 'dashboard_setup'));
     add_action('wp_ajax_better-analytics_heatmaps', array($this, 'display_page'));
     add_action('wp_ajax_better-analytics_area_charts', array($this, 'display_page'));
     add_action('wp_ajax_better-analytics_monitor', array($this, 'display_page'));
     add_action('wp_ajax_better-analytics_events', array($this, 'display_page'));
     add_action('wp_ajax_better-analytics_charts', array($this, 'display_charts'));
     add_filter('plugin_action_links', array($this, 'plugin_action_links'), 10, 2);
     add_filter('wp_redirect', array($this, 'filter_redirect'));
     add_filter('admin_footer_text', array($this, 'admin_footer_text'));
     add_filter('all_plugins', array($this, 'all_plugins'));
     add_filter('plugin_row_meta', array($this, 'plugin_row_meta'), 10, 2);
     add_filter('wpmu_options', array($this, 'show_network_settings'));
     add_action('update_wpmu_options', array($this, 'save_network_settings'));
     add_filter('removable_query_args', array($this, 'removable_query_args'));
     $betterAnalyticsOptions = get_option('better_analytics');
     if (!$betterAnalyticsOptions['property_id']) {
         add_action('admin_notices', array($this, 'not_configured'));
     }
     if (!get_site_option('ba_site_tokens') && !get_option('ba_tokens')) {
         add_action('admin_notices', array($this, 'cant_auto_configure'));
     } elseif (!$betterAnalyticsOptions['api']['profile']) {
         add_action('admin_notices', array($this, 'can_auto_configure'));
     }
     if (get_transient('ba_last_error')) {
         add_action('admin_notices', array($this, 'last_error'));
     }
 }
开发者ID:Vatia13,项目名称:tofido,代码行数:33,代码来源:Admin.php


示例4: test_get_doesnt_cache_default_value

 function test_get_doesnt_cache_default_value()
 {
     $option = rand_str();
     $default = 'a default';
     $this->assertEquals(get_site_option($option, $default), $default);
     $this->assertFalse(get_site_option($option));
 }
开发者ID:Benrajalu,项目名称:philRaj,代码行数:7,代码来源:siteOption.php


示例5: get_network_option

 function get_network_option($optionName, $defaultValue = '')
 {
     if ($this->use_site_option()) {
         return get_site_option($optionName, $defaultValue);
     }
     return get_option($optionName, $defaultValue);
 }
开发者ID:dparks-seattletimes,项目名称:openworldstudios,代码行数:7,代码来源:Livefyre_Application.php


示例6: run

 /**
  * Setup the module's administrative functionality
  *
  * Loads the database backup module's privileged functionality including
  * settings fields.
  *
  * @since 4.0.0
  *
  * @param ITSEC_Core $core The core plugin instance
  *
  * @return void
  */
 function run($core)
 {
     $this->core = $core;
     $this->settings = get_site_option('itsec_backup');
     $this->module_path = ITSEC_Lib::get_module_path(__FILE__);
     add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
     //enqueue scripts for admin page
     add_action('itsec_add_admin_meta_boxes', array($this, 'itsec_add_admin_meta_boxes'));
     //add meta boxes to admin page
     add_action('itsec_admin_init', array($this, 'itsec_admin_init'));
     //initialize admin area
     add_filter('itsec_add_dashboard_status', array($this, 'itsec_add_dashboard_status'));
     //add information for plugin status
     add_filter('itsec_tooltip_modules', array($this, 'itsec_tooltip_modules'));
     //register tooltip action
     add_filter('itsec_tracking_vars', array($this, 'itsec_tracking_vars'));
     if (isset($_POST['itsec_backup']) && $_POST['itsec_backup'] == 'one_time_backup') {
         add_action('itsec_admin_init', array($this, 'one_time_backup'));
     }
     //manually save options on multisite
     if (is_multisite()) {
         add_action('itsec_admin_init', array($this, 'itsec_admin_init_multisite'));
         //save multisite options
     }
 }
开发者ID:femgineer,项目名称:website,代码行数:37,代码来源:class-itsec-backup-admin.php


示例7: _getOption

 protected function _getOption($option)
 {
     switch ($option) {
         case 'apiClientId':
             $betterAnalyticsSiteOptions = get_site_option('better_analytics_site');
             $betterAnalyticsOptions = get_option('better_analytics');
             if (!empty($betterAnalyticsSiteOptions['api']['use_own'])) {
                 return @$betterAnalyticsSiteOptions['api']['client_id'];
             } elseif (!empty($betterAnalyticsOptions['api']['use_own'])) {
                 return @$betterAnalyticsOptions['api']['client_id'];
             } else {
                 return $this->_credentials['client_id'];
             }
         case 'apiClientSecret':
             $betterAnalyticsSiteOptions = get_site_option('better_analytics_site');
             $betterAnalyticsOptions = get_option('better_analytics');
             if (!empty($betterAnalyticsSiteOptions['api']['use_own'])) {
                 return @$betterAnalyticsSiteOptions['api']['client_secret'];
             } elseif (!empty($betterAnalyticsOptions['api']['use_own'])) {
                 return @$betterAnalyticsOptions['api']['client_secret'];
             } else {
                 return $this->_credentials['client_secret'];
             }
         case 'apiProfile':
             $betterAnalyticsOptions = get_option('better_analytics');
             return @$betterAnalyticsOptions['api']['profile'];
         case 'tokens':
             return @json_decode(DigitalPointBetterAnalytics_Base_Public::getInstance()->getTokens());
         case 'internalV':
             $betterAnalyticsOptions = get_transient('ba_int');
             return @$betterAnalyticsOptions['v'];
         default:
             return false;
     }
 }
开发者ID:Vatia13,项目名称:tofido,代码行数:35,代码来源:Reporting.php


示例8: get_themes

 /**
  * Return a filtered list of themes
  *
  * @since 1.0
  * @return array
  */
 public function get_themes()
 {
     $default_themes = $this->default_themes();
     if ($saved_themes = get_site_option("megamenu_themes")) {
         foreach ($default_themes as $key => $settings) {
             if ($key != 'default') {
                 $default_themes[$key] = array_merge($default_themes['default'], $default_themes[$key]);
             }
             // Merge in any custom modifications to default themes
             if (isset($saved_themes[$key])) {
                 $default_themes[$key] = array_merge($default_themes[$key], $saved_themes[$key]);
                 unset($saved_themes[$key]);
             }
         }
         foreach ($saved_themes as $key => $settings) {
             // Add in saved themes, ensuring they always have a placeholder for any new settings
             // which have since been added to the default theme.
             $default_themes[$key] = array_merge($default_themes['default'], $settings);
         }
     }
     // process replacements
     foreach ($default_themes as $key => $settings) {
         foreach ($settings as $var => $val) {
             if (isset($default_themes[$key][$val])) {
                 $default_themes[$key][$var] = $default_themes[$key][$val];
             }
         }
     }
     uasort($default_themes, array($this, 'sort_by_title'));
     return $default_themes;
 }
开发者ID:hieu-pv,项目名称:danaband,代码行数:37,代码来源:style-manager.class.php


示例9: swift_get_settings

 function swift_get_settings($force = false)
 {
     if (is_null($this->settings) || $force) {
         $this->settings = get_site_option(static::SETTINGS_KEY);
     }
     return $this->settings;
 }
开发者ID:minok,项目名称:wp-bluemix-objectstorage,代码行数:7,代码来源:swift-plugin-base.php


示例10: get_locale

/**
 * Get the current locale.
 *
 * If the locale is set, then it will filter the locale in the 'locale' filter
 * hook and return the value.
 *
 * If the locale is not set already, then the WPLANG constant is used if it is
 * defined. Then it is filtered through the 'locale' filter hook and the value
 * for the locale global set and the locale is returned.
 *
 * The process to get the locale should only be done once, but the locale will
 * always be filtered using the 'locale' hook.
 *
 * @since 1.5.0
 *
 * @return string The locale of the blog or from the 'locale' hook.
 */
function get_locale()
{
    global $locale;
    if (isset($locale)) {
        /**
         * Filter WordPress install's locale ID.
         *
         * @since 1.5.0
         *
         * @param string $locale The locale ID.
         */
        return apply_filters('locale', $locale);
    }
    // WPLANG is defined in wp-config.
    if (defined('WPLANG')) {
        $locale = WPLANG;
    }
    // If multisite, check options.
    if (is_multisite()) {
        // Don't check blog option when installing.
        if (defined('WP_INSTALLING') || false === ($ms_locale = get_option('WPLANG'))) {
            $ms_locale = get_site_option('WPLANG');
        }
        if ($ms_locale !== false) {
            $locale = $ms_locale;
        }
    }
    if (empty($locale)) {
        $locale = 'en_US';
    }
    /** This filter is documented in wp-includes/l10n.php */
    return apply_filters('locale', $locale);
}
开发者ID:sdgdsffdsfff,项目名称:shipin,代码行数:50,代码来源:l10n.php


示例11: __construct

 /**
  * Set up the API module.
  *
  * @since 4.0.0
  * @internal
  */
 public function __construct()
 {
     if (WPMUDEV_CUSTOM_API_SERVER) {
         $this->server_root = trailingslashit(WPMUDEV_CUSTOM_API_SERVER);
     }
     $this->server_url = $this->server_root . $this->rest_api;
     if (defined('WPMUDEV_APIKEY') && WPMUDEV_APIKEY) {
         $this->api_key = WPMUDEV_APIKEY;
     } else {
         // If 'clear_key' is present in URL then do not load the key from DB.
         $this->api_key = get_site_option('wpmudev_apikey');
     }
     // Schedule automatic data update on the main site of the network.
     if (is_main_site()) {
         if (!wp_next_scheduled('wpmudev_scheduled_jobs')) {
             wp_schedule_event(time(), 'twicedaily', 'wpmudev_scheduled_jobs');
         }
         add_action('wpmudev_scheduled_jobs', array($this, 'refresh_membership_data'));
     } elseif (wp_next_scheduled('wpmudev_scheduled_jobs')) {
         // In case the cron job was already installed in a sub-site...
         wp_clear_scheduled_hook('wpmudev_scheduled_jobs');
     }
     /**
      * Run custom initialization code for the API module.
      *
      * @since  4.0.0
      * @var  WPMUDEV_Dashboard_Api The dashboards API module.
      */
     do_action('wpmudev_dashboard_api_init', $this);
 }
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:36,代码来源:class-wpmudev-dashboard-api.php


示例12: the_data

 private function the_data()
 {
     $usage = get_site_option('wpe_upload_space_usage');
     $ttl = get_site_option('wpe_upload_space_usage_ttl');
     // If TTL is more then interval from now, it's bogus, so kill it.
     if ($ttl > time() + self::CACHE_TTL) {
         $ttl = false;
     }
     // If have from cache and it's within TTL, then do nothing else.
     // If TTL has not expired, leave
     if ($ttl && $ttl >= time()) {
         return $usage;
     }
     // Get the value and save it in the cache
     $usage_remote = $this->from_remote();
     $expire = time() + self::CACHE_TTL;
     // If did not have an initial value
     if (false === $usage) {
         add_site_option('wpe_upload_space_usage', $usage_remote);
         add_site_option('wpe_upload_space_usage_ttl', $expire);
     } else {
         update_site_option('wpe_upload_space_usage', $usage_remote);
         update_site_option('wpe_upload_space_usage_ttl', $expire);
     }
     return $usage_remote;
 }
开发者ID:tconte252,项目名称:haute-inhabit,代码行数:26,代码来源:class.wpeapi.php


示例13: undismiss_core_update

function undismiss_core_update( $version, $locale ) {
	$dismissed = get_site_option( 'dismissed_update_core' );
	$key = $version.'|'.$locale;
	if ( !isset( $dismissed[$key] ) ) return false;
	unset( $dismissed[$key] );
	return update_site_option( 'dismissed_update_core', $dismissed );
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:7,代码来源:update.php


示例14: execute_activate

 /**
  * Execute module activation.
  *
  * @since 4.0
  *
  * @return void
  */
 public function execute_activate()
 {
     $options = get_site_option('itsec_password');
     if ($options === false) {
         add_site_option('itsec_password', $this->defaults);
     }
 }
开发者ID:femgineer,项目名称:website,代码行数:14,代码来源:setup.php


示例15: run

 function run()
 {
     $this->settings = get_site_option('itsec_four_oh_four');
     add_filter('itsec_lockout_modules', array($this, 'register_lockout'));
     add_filter('itsec_logger_modules', array($this, 'register_logger'));
     add_action('wp_head', array($this, 'check_404'));
 }
开发者ID:femgineer,项目名称:website,代码行数:7,代码来源:class-itsec-four-oh-four.php


示例16: myplugin_update_db_check

function myplugin_update_db_check()
{
    global $wingspersonalplugin_db_version;
    if (get_site_option('wingspersonalplugin_db_version') != $wingspersonalplugin_db_version) {
        wingsInstallPlugin();
    }
}
开发者ID:proudchild,项目名称:sdmblog,代码行数:7,代码来源:wingsPersonalOverlib.php


示例17: aiowps_send_file_change_alert_email

 function aiowps_send_file_change_alert_email()
 {
     global $aio_wp_security;
     if ($aio_wp_security->configs->get_value('aiowps_send_fcd_scan_email') == '1') {
         //Get the right email address.
         if (is_email($aio_wp_security->configs->get_value('aiowps_fcd_scan_email_address'))) {
             $toaddress = $aio_wp_security->configs->get_value('aiowps_fcd_scan_email_address');
         } else {
             $toaddress = get_site_option('admin_email');
         }
         $to = $toaddress;
         $site_title = get_bloginfo('name');
         $from_name = empty($site_title) ? 'WordPress' : $site_title;
         $headers = 'From: ' . $from_name . ' <' . get_option('admin_email') . '>' . PHP_EOL;
         $subject = __('All In One WP Security - File change detected!', 'aiowpsecurity') . ' ' . date('l, F jS, Y \\a\\t g:i a', current_time('timestamp'));
         //$attachment = array();
         $message = __('A file change was detected on your system for site URL', 'aiowpsecurity') . ' ' . get_option('siteurl') . __('. Scan was generated on', 'aiowpsecurity') . ' ' . date('l, F jS, Y \\a\\t g:i a', current_time('timestamp'));
         $message .= "\r\n\r\n" . __('A summary of the scan results is shown below:', 'aiowpsecurity');
         $scan_res_unserialized = self::get_file_change_data();
         $scan_results_message = '';
         if ($scan_res_unserialized !== false) {
             $scan_results_message = self::get_file_change_summary($scan_res_unserialized);
         }
         $message .= "\r\n\r\n";
         $message .= $scan_results_message;
         $message .= "\r\n" . __('Login to your site to view the scan details.', 'aiowpsecurity');
         wp_mail($to, $subject, $message, $headers);
     }
 }
开发者ID:Bakerpedia,项目名称:Development_Site5,代码行数:29,代码来源:wp-security-file-scan.php


示例18: deactivate_other_instances

 /**
  * Checks if another version of WPMDB(Pro) is active and deactivates it.
  * To be hooked on `activated_plugin` so other plugin is deactivated when current plugin is activated.
  *
  * @param string $plugin
  *
  */
 public static function deactivate_other_instances($plugin)
 {
     if (!in_array(basename($plugin), array('wp-migrate-db-pro.php', 'wp-migrate-db.php'))) {
         return;
     }
     $plugin_to_deactivate = 'wp-migrate-db.php';
     $deactivated_notice_id = '1';
     if (basename($plugin) == $plugin_to_deactivate) {
         $plugin_to_deactivate = 'wp-migrate-db-pro.php';
         $deactivated_notice_id = '2';
     }
     if (is_multisite()) {
         $active_plugins = (array) get_site_option('active_sitewide_plugins', array());
         $active_plugins = array_keys($active_plugins);
     } else {
         $active_plugins = (array) get_option('active_plugins', array());
     }
     foreach ($active_plugins as $basename) {
         if (false !== strpos($basename, $plugin_to_deactivate)) {
             set_transient('wp_migrate_db_deactivated_notice_id', $deactivated_notice_id, 1 * HOUR_IN_SECONDS);
             deactivate_plugins($basename);
             return;
         }
     }
 }
开发者ID:arobbins,项目名称:davis,代码行数:32,代码来源:wpmdb-utils.php


示例19: init

 /**
  * Init Vindi_Dependencies.
  */
 public static function init()
 {
     self::$active_plugins = (array) get_option('active_plugins', array());
     if (is_multisite()) {
         self::$active_plugins = array_merge(self::$active_plugins, get_site_option('active_sitewide_plugins', array()));
     }
 }
开发者ID:vindi,项目名称:vindi-woocommerce-subscriptions,代码行数:10,代码来源:class-vindi-dependencies.php


示例20: check

 /**
  * @public
  * @static
  */
 public static function check()
 {
     $is_installed = is_multisite() ? get_site_option('wdeb') : get_option('wdeb');
     if (!$is_installed) {
         Wdeb_Installer::install();
     }
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:11,代码来源:class_wdeb_installer.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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