本文整理汇总了PHP中wp_load_alloptions函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_load_alloptions函数的具体用法?PHP wp_load_alloptions怎么用?PHP wp_load_alloptions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_load_alloptions函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: export
/**
* Export package configuration
*
* @return string
*/
public function export()
{
global $wp_version;
// Get options
$options = wp_load_alloptions();
// Get Site URL
$site_url = site_url();
if (isset($options['siteurl'])) {
$site_url = rtrim($options['siteurl'], '/');
}
// Get Home URL
$home_url = home_url();
if (isset($options['home'])) {
$home_url = rtrim($options['home'], '/');
}
// Default configuration
$config = array('SiteURL' => $site_url, 'HomeURL' => $home_url, 'Plugin' => array('Version' => AI1WM_VERSION), 'WordPress' => array('Version' => $wp_version, 'Content' => WP_CONTENT_DIR));
// Get user identity
if (apply_filters('ai1wm_keep_user_identity_on_export', false)) {
$config['Export']['User'] = array('Id' => get_current_user_id());
}
// Save package file
$package = file_put_contents($this->storage()->package(), json_encode($config));
if (false === $package) {
throw new Ai1wm_Import_Exception('Unable to write package.json file');
}
}
开发者ID:HeoChauA,项目名称:coffeedesign.org,代码行数:32,代码来源:class-ai1wm-service-package.php
示例2: get_context
/**
* Custom implementation for get_context method.
*/
public function get_context()
{
global $content_width;
if (class_exists('Easy_Digital_Downloads')) {
global $edd_options;
}
$context = Timber::get_context();
$sidebar_primary = Timber::get_widgets('sidebar_primary');
$sidebar_footer = Timber::get_widgets('sidebar_footer');
$context['theme_mods'] = get_theme_mods();
$context['site_options'] = wp_load_alloptions();
$context['teaser_mode'] = apply_filters('maera/teaser/mode', 'excerpt');
$context['thumbnail']['width'] = apply_filters('maera/image/width', 600);
$context['thumbnail']['height'] = apply_filters('maera/image/height', 371);
$context['menu']['primary'] = has_nav_menu('primary_navigation') ? new TimberMenu('primary_navigation') : null;
$context['sidebar']['primary'] = apply_filters('maera/sidebar/primary', $sidebar_primary);
$context['sidebar']['footer'] = apply_filters('maera/sidebar/footer', $sidebar_footer);
$context['pagination'] = Timber::get_pagination();
$context['comment_form'] = TimberHelper::get_comment_form();
$context['comments_args'] = array('style' => 'ul', 'reply_text' => __('Reply', 'maera'), 'short_ping' => true, 'avatar_size' => 60);
$context['site_logo'] = get_option('site_logo', false);
$context['content_width'] = $content_width;
$context['sidebar_template'] = maera_templates_sidebar();
if (class_exists('Easy_Digital_Downloads')) {
$data['edd_options'] = $edd_options;
$data['download_categories'] = Timber::get_terms('download_category');
$data['download_tags'] = Timber::get_terms('download_tag');
$data['default_image'] = new TimberImage(get_template_directory_uri() . '/assets/images/default.png');
}
return apply_filters('maera/timber/context', $context);
}
开发者ID:wpmu,项目名称:maera,代码行数:34,代码来源:class-maera-timber.php
示例3: add_to_context
function add_to_context($context)
{
$context['foo'] = 'bar';
$context['stuff'] = 'I am a value set in your functions.php file';
$context['notes'] = 'These values are available everytime you call Timber::get_context();';
$context['menu'] = new TimberMenu();
//$context['custom_wp_nav_menu'] = wp_nav_menu( array( 'container_class' => 'menu-header', 'echo' => false, 'menu_class' => 'nav-menu' ) );
$context['custom_wp_nav_menu'] = wp_nav_menu(array('container_class' => 'menu-header', 'echo' => false, 'menu_class' => 'nav-menu'));
$context['site'] = $this;
$context['theme_url'] = get_stylesheet_directory_uri();
$context['is_logged_in'] = is_user_logged_in();
$context['theme_mod'] = get_theme_mods();
$context['options'] = wp_load_alloptions();
$context['site_url'] = site_url();
if (is_home() || is_front_page()) {
$context['is_home'] = true;
}
/*
* Footer
*/
$context['footer_tag_line'] = get_option('footer_text');
$context['footer_address'] = get_option('address');
$context['footer_site_url'] = site_url();
$context['footer_inquiry_mail'] = get_option('inquiry_mail');
$context['footer_telephone'] = get_option('telephone');
$context['s_facebook'] = get_option('facebook');
$context['s_twitter'] = get_option('twitter');
$context['s_linkedin'] = get_option('linkedin');
$context['footer_copyright'] = get_option('copyright');
return $context;
}
开发者ID:sumeetgohel1990,项目名称:triangle,代码行数:31,代码来源:functions.php
示例4: blogolife_settings_page
function blogolife_settings_page()
{
?>
<div class='wrap'>
<h1><?php
_e('BlogoLife old settings', 'blogolife');
?>
</h1>
<?php
$all_options = wp_load_alloptions();
$old_settings = array('wpl_logo_url', 'wpl_header_desc', 'wpl_ga_code', 'wpl_css', 'wpl_menu', 'wpl_next_preview_post', 'wpl_rss', 'wpl_favicon_url', 'wpl_display_categories_post', 'wpl_display_author_post', 'wpl_display_date_post', 'wpl_display_author_page', 'wpl_display_date_page', 'wpl_nivo', 'wpl_share_buttons_page', 'wpl_share_buttons_post', 'wpl_twitter', 'wpl_google_plus', 'wpl_facebook', 'wpl_linkedin', 'wpl_tumblr', 'wpl_delicious', 'wpl_digg', 'wpl_stumbleupon', 'wpl_flickr', 'wpl_picasa', 'wpl_youtube', 'wpl_dribbble', 'wpl_pinterest', 'wpl_meta_description', 'wpl_meta_keywords');
$my_options = array();
foreach ($all_options as $name => $value) {
if (stristr($name, 'wpl_') && $value != '') {
if (in_array($name, $old_settings)) {
if ($name === 'wpl_ga_code') {
$ua_regex = "/UA-[0-9]{5,}-[0-9]{1,}/";
preg_match_all($ua_regex, $value, $ua_id);
$my_options[$name] = $ua_id[0][0];
} else {
$my_options[$name] = $value;
}
}
}
}
echo "<pre>";
print_r($my_options);
echo "</pre>";
?>
</div>
<?php
}
开发者ID:jun200,项目名称:wordpress,代码行数:32,代码来源:old-settings.php
示例5: bapi_wp_site_options
function bapi_wp_site_options()
{
global $bapi_all_options;
$bapi_all_options = wp_load_alloptions();
if (!isset($bapi_all_options['bapi_solutiondata'])) {
$bapi_all_options['bapi_solutiondata'] = '';
}
if (!isset($bapi_all_options['bapi_solutiondata_lastmod'])) {
$bapi_all_options['bapi_solutiondata_lastmod'] = 0;
}
if (!isset($bapi_all_options['bapi_keywords_array'])) {
$bapi_all_options['bapi_keywords_array'] = '';
}
if (!isset($bapi_all_options['bapi_keywords_lastmod'])) {
$bapi_all_options['bapi_keywords_lastmod'] = 0;
}
if (!isset($bapi_all_options['bapi_language'])) {
$bapi_all_options['bapi_language'] = 'en-US';
}
if (!isset($bapi_all_options['bapi_baseurl'])) {
$bapi_all_options['bapi_baseurl'] = 'connect.bookt.com';
}
if (defined('BAPI_BASEURL')) {
$bapi_all_options['bapi_baseurl'] = BAPI_BASEURL;
}
if (!isset($bapi_all_options['bapi_first_look'])) {
$bapi_all_options['bapi_first_look'] = 0;
}
//print_r($bapi_all_options); exit();
}
开发者ID:alfiedawes,项目名称:WP-InstaSites,代码行数:30,代码来源:functions.php
示例6: get_options
/**
* Set site options.
* @return $this
*/
public function get_options()
{
switch_to_blog($this->_my_site->blog_id);
$this->_my_data["options"] = wp_load_alloptions();
restore_current_blog();
return $this;
}
开发者ID:Aranjedeath,项目名称:sitegenerator,代码行数:11,代码来源:lib_website.php
示例7: remove_um
function remove_um()
{
global $ultimatemember;
foreach (wp_load_alloptions() as $k => $v) {
if (substr($k, 0, 3) == 'um_') {
if ($k == 'um_core_pages') {
$v = unserialize($v);
foreach ($v as $post_id) {
wp_delete_post($post_id, 1);
}
}
delete_option($k);
}
}
$forms = get_posts(array('post_type' => 'um_form', 'numberposts' => -1));
foreach ($forms as $form) {
wp_delete_post($form->ID, 1);
}
$directories = get_posts(array('post_type' => 'um_directory', 'numberposts' => -1));
foreach ($directories as $directory) {
wp_delete_post($directory->ID, 1);
}
$roles = get_posts(array('post_type' => 'um_role', 'numberposts' => -1));
foreach ($roles as $role) {
wp_delete_post($role->ID, 1);
}
if (is_plugin_active(um_plugin)) {
deactivate_plugins(um_plugin);
}
exit(wp_redirect(admin_url('plugins.php')));
}
开发者ID:Zurtr,项目名称:ultimatemember,代码行数:31,代码来源:um-uninstall.php
示例8: aa_app_options
function aa_app_options()
{
ob_start();
echo "<pre>";
print_r(wp_load_alloptions());
echo "</pre>";
return ob_get_clean();
}
开发者ID:Nayami,项目名称:wpang,代码行数:8,代码来源:shortcodes.php
示例9: zh_cn_l10n_save_patch_states
/**
* Changes the state of a certain patch in the database
*
* @since 3.3.0
*/
function zh_cn_l10n_save_patch_states($patch_id, $updated_state, $flush = false)
{
$_zh_cn_l10n_preference_patches = unserialize(get_option('zh_cn_l10n_preference_patches'));
$_zh_cn_l10n_preference_patches[$patch_id] = $updated_state;
update_option('zh_cn_l10n_preference_patches', serialize($_zh_cn_l10n_preference_patches));
if ($flush) {
wp_load_alloptions();
}
}
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:14,代码来源:zh_CN.php
示例10: eme_options_delete
function eme_options_delete()
{
$all_options = wp_load_alloptions();
foreach ($all_options as $name => $value) {
if (preg_match('/^eme_/', $name)) {
delete_option($name);
}
}
}
开发者ID:simeont9,项目名称:stoneopen,代码行数:9,代码来源:eme_options.php
示例11: test_set_site_transient_is_not_stored_as_autoload_option
/**
* @ticket 22846
*/
public function test_set_site_transient_is_not_stored_as_autoload_option()
{
$key = 'not_autoloaded';
if (is_multisite()) {
$this->markTestSkipped('Does not apply when used in multisite.');
}
set_site_transient($key, 'Not an autoload option');
$options = wp_load_alloptions();
$this->assertFalse(isset($options['_site_transient_' . $key]));
}
开发者ID:CompositeUK,项目名称:clone.WordPress-Develop,代码行数:13,代码来源:siteTransient.php
示例12: test_update_network_option_is_not_stored_as_autoload_option
/**
* @ticket 22846
*/
public function test_update_network_option_is_not_stored_as_autoload_option()
{
$key = rand_str();
if (is_multisite()) {
$this->markTestSkipped('Does not apply when used in multisite.');
}
update_network_option(null, $key, 'Not an autoload option');
$options = wp_load_alloptions();
$this->assertFalse(isset($options[$key]));
}
开发者ID:atimmer,项目名称:wordpress-develop-mirror,代码行数:13,代码来源:networkOption.php
示例13: theme_admin_print_scripts
function theme_admin_print_scripts()
{
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-bqq');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-tabs');
wp_enqueue_script('theme-admin');
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
wp_enqueue_style("google-font-open-sans", "http://fonts.googleapis.com/css?family=Open+Sans:400,600");
$sidebars = array("default" => array(array("name" => "header", "label" => __("header", 'medicenter')), array("name" => "footer_top", "label" => __("footer top", 'medicenter')), array("name" => "footer_bottom", "label" => __("footer bottom", 'medicenter'))), "template-blog.php" => array(array("name" => "header", "label" => __("header", 'medicenter')), array("name" => "footer_top", "label" => __("footer top", 'medicenter')), array("name" => "footer_bottom", "label" => __("footer bottom", 'medicenter'))), "single.php" => array(array("name" => "header", "label" => __("header", 'medicenter')), array("name" => "footer_top", "label" => __("footer top", 'medicenter')), array("name" => "footer_bottom", "label" => __("footer bottom", 'medicenter'))), "single-features.php" => array(array("name" => "header", "label" => __("header", 'medicenter')), array("name" => "footer_top", "label" => __("footer top", 'medicenter')), array("name" => "footer_bottom", "label" => __("footer bottom", 'medicenter'))), "search.php" => array(array("name" => "header", "label" => __("header", 'medicenter')), array("name" => "footer_top", "label" => __("footer top", 'medicenter')), array("name" => "footer_bottom", "label" => __("footer bottom", 'medicenter'))), "template-default-without-breadcrumbs.php" => array(array("name" => "footer_top", "label" => __("footer top", 'medicenter')), array("name" => "footer_bottom", "label" => __("footer bottom", 'medicenter'))), "template-home.php" => array(array("name" => "top", "label" => __("top", 'medicenter')), array("name" => "footer_top", "label" => __("footer top", 'medicenter')), array("name" => "footer_bottom", "label" => __("footer bottom", 'medicenter'))), "404.php" => array(array("name" => "header", "label" => __("header", 'medicenter')), array("name" => "footer_top", "label" => __("footer top", 'medicenter')), array("name" => "footer_bottom", "label" => __("footer bottom", 'medicenter'))));
//get theme sidebars
$theme_sidebars = array();
$theme_sidebars_array = get_posts(array('post_type' => 'medicenter_sidebars', 'posts_per_page' => '-1', 'post_status' => 'publish', 'orderby' => 'menu_order', 'order' => 'ASC'));
for ($i = 0; $i < count($theme_sidebars_array); $i++) {
$theme_sidebars[$i]["id"] = $theme_sidebars_array[$i]->ID;
$theme_sidebars[$i]["title"] = $theme_sidebars_array[$i]->post_title;
}
//get theme sliders
$sliderAllShortcodeIds = array();
$allOptions = wp_load_alloptions();
foreach ($allOptions as $key => $value) {
if (substr($key, 0, 26) == "medicenter_slider_settings") {
$sliderAllShortcodeIds[] = $key;
}
}
//get revolution sliders
if (is_plugin_active('revslider/revslider.php')) {
global $wpdb;
$rs = $wpdb->get_results("\r\n\t\tSELECT id, title, alias\r\n\t\tFROM " . $wpdb->prefix . "revslider_sliders\r\n\t\tORDER BY id ASC LIMIT 100\r\n\t\t");
if ($rs) {
foreach ($rs as $slider) {
$sliderAllShortcodeIds[] = "revolution_slider_settings_" . $slider->alias;
}
}
}
//get layer sliders
if (is_plugin_active('LayerSlider/layerslider.php')) {
global $wpdb;
$ls = $wpdb->get_results("\r\n\t\tSELECT id, name, date_c\r\n\t\tFROM " . $wpdb->prefix . "layerslider\r\n\t\tWHERE flag_hidden = '0' AND flag_deleted = '0'\r\n\t\tORDER BY date_c ASC LIMIT 999\r\n\t\t");
$layer_sliders = array();
if ($ls) {
foreach ($ls as $slider) {
$sliderAllShortcodeIds[] = "aaaaalayer_slider_settings_" . $slider->id;
}
}
}
//sort slider ids
sort($sliderAllShortcodeIds);
$data = array('img_url' => get_template_directory_uri() . "/images/", 'admin_img_url' => get_template_directory_uri() . "/admin/images/", 'sidebar_label' => __('Sidebar', 'medicenter'), 'slider_label' => __('Main Slider', 'medicenter'), 'sidebars' => $sidebars, 'theme_sidebars' => $theme_sidebars, 'page_sidebars' => get_post_meta(get_the_ID(), "medicenter_page_sidebars", true), 'theme_sliders' => $sliderAllShortcodeIds, 'main_slider' => get_post_meta(get_the_ID(), "main_slider", true));
//pass data to javascript
$params = array('l10n_print_after' => 'config = ' . json_encode($data) . ';');
wp_localize_script("theme-admin", "config", $params);
}
开发者ID:farkbarn,项目名称:hcudamp,代码行数:55,代码来源:functions.php
示例14: _wpcom_vip_maybe_clear_alloptions_cache
/**
* Fix a race condition in alloptions caching
*
* See https://core.trac.wordpress.org/ticket/31245
*/
function _wpcom_vip_maybe_clear_alloptions_cache($option)
{
if (!wp_installing()) {
$alloptions = wp_load_alloptions();
//alloptions should be cached at this point
if (isset($alloptions[$option])) {
//only if option is among alloptions
wp_cache_delete('alloptions', 'options');
}
}
}
开发者ID:Automattic,项目名称:vip-mu-plugins-public,代码行数:16,代码来源:misc.php
示例15: all
/**
* Returns all options
*
* @param string $prefix
* @return array
*/
public function all($prefix)
{
$options = wp_load_alloptions();
$pluginOptions = array();
foreach ($options as $key => $value) {
if (substr($key, 0, $length = strlen($prefix)) === $prefix) {
$pluginOptions[substr($key, $length)] = $value;
}
}
return $pluginOptions;
}
开发者ID:estrategasdigitales,项目名称:dictobas,代码行数:17,代码来源:WordpressStorage.php
示例16: display
function display($file)
{
global $wp_styles;
wp_load_alloptions();
do_action('after_setup_theme');
$_SESSION['wp_init'] = false;
do_action('init');
try {
include APPL_PATH . $this->templates . DIR_SEP . $file;
} catch (Exception $e) {
}
}
开发者ID:basdog22,项目名称:Qool,代码行数:12,代码来源:Wordpress.php
示例17: icl_st_scan_options_strings
function icl_st_scan_options_strings()
{
$options = wp_load_alloptions();
foreach ($options as $name => $value) {
if ($this->is_blacklisted($name)) {
unset($options[$name]);
} else {
$options[$name] = maybe_unserialize($value);
}
}
return $options;
}
开发者ID:Junaid-Farid,项目名称:gocnex,代码行数:12,代码来源:wpml-admin-texts.class.php
示例18: add
/**
* 自动处理保存在数据库中的 Portal,自动发表新文章,用于计划任务
*
* @version 0.13.10.17
*/
function add()
{
$option = wp_load_alloptions();
foreach ($option as $key => $value) {
if (0 === strpos($key, 'idea_ingress_portal_')) {
$this->portal = array_merge($this->portal, unserialize($value));
delete_option($key);
}
}
// var_dump ( $this->portal );
$this->insert_portal();
}
开发者ID:023yangbo,项目名称:WordPress,代码行数:17,代码来源:IdeaIngress.php
示例19: remove_preview_options
public static function remove_preview_options()
{
if (!HeadwayCapabilities::can_user_visually_edit()) {
return;
}
//Fetch all options in wp_options and remove the preview-specific options
foreach (wp_load_alloptions() as $option => $option_value) {
//This if statement is incredibly important and must not be tampered with and needs to be triple-checked if changed.
if (preg_match('/^headway_(.*)?_preview$/', $option) && strpos($option, 'headway_') === 0 && strpos($option, '_preview') !== false) {
delete_option($option);
}
}
}
开发者ID:danaiser,项目名称:hollandLawns,代码行数:13,代码来源:preview.php
示例20: rs_wpss_uninstall_plugin
function rs_wpss_uninstall_plugin()
{
/* Delete Options */
$del_options = array('wp_spamshield_version', 'spamshield_options', 'spamshield_widget_settings', 'spamshield_last_admin', 'spamshield_admins', 'spamshield_admin_notices', 'spamshield_count', 'spamshield_reg_count', 'spamshield_procdat', 'spamshield_install_status', 'spamshield_warning_status', 'spamshield_regalert_status', 'spamshield_nonces', 'spamshield_wpssmid_cache', 'spamshield_ubl_cache', 'spamshield_ubl_cache_disable', 'spamshield_ip_ban_disable', 'spamshield_ip_ban', 'spamshield_whitelist_keys', 'ak_count_pre', 'spamshield_init_user_approve_run');
foreach ($del_options as $i => $option) {
delete_option($option);
}
/* TO DO: When Network Activation enabled, add Multisite - delete_site_option() */
/* Delete Transients */
$del_trans = array('wpss_iswpv_check');
foreach ($del_trans as $i => $transient) {
delete_transient($transient);
delete_site_transient($transient);
}
/* Unregister Widgets */
$unreg_widgets = array('WP_SpamShield_Counter_LG', 'WP_SpamShield_Counter_CG', 'WP_SpamShield_End_Blog_Spam');
foreach ($unreg_widgets as $i => $widget) {
unregister_widget($widget);
}
/* Clean Up Widget Options */
$all_widgets = get_option('sidebars_widgets');
foreach ($all_widgets as $i => $s) {
if (is_array($s)) {
foreach ($s as $k => $v) {
if (FALSE !== strpos($v, 'spamshield')) {
unset($all_widgets[$i][$k]);
}
}
$all_widgets[$i] = array_values($all_widgets[$i]);
}
}
update_option('sidebars_widgets', $all_widgets);
/* Delete Orphaned Options */
$all_options = wp_load_alloptions();
foreach ($all_options as $option => $value) {
if (FALSE !== strpos($option, 'spamshield')) {
delete_option($option);
}
/* TO DO: When Network Activation enabled, add Multisite - delete_site_option() */
}
/* Delete User Meta */
$del_user_meta = array('wpss_user_ip', 'wpss_admin_status', 'wpss_new_user_approved', 'wpss_new_user_email_sent', 'wpss_cpn_status', 'wpss_cpn_notices', 'wpss_nag_status', 'wpss_nag_notices');
$user_ids = get_users(array('blog_id' => '', 'fields' => 'ID'));
foreach ($user_ids as $user_id) {
foreach ($del_user_meta as $i => $key) {
delete_user_meta($user_id, $key);
}
}
/* Clear Banned IP Info */
rs_wpss_uninstall_ip_ban_htaccess();
}
开发者ID:kding0409,项目名称:kding0409.github.io,代码行数:51,代码来源:uninstall.php
注:本文中的wp_load_alloptions函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论