本文整理汇总了PHP中op_update_option函数的典型用法代码示例。如果您正苦于以下问题:PHP op_update_option函数的具体用法?PHP op_update_option怎么用?PHP op_update_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了op_update_option函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: initalize_theme
function initalize_theme()
{
$pages = array(OP_SN, OP_SN . '-setup-wizard');
$reinit_theme = $reinit_page_theme = false;
$disable_theme = false;
if (isset($_GET['page'])) {
if ($_GET['page'] == OP_SN || $_GET['page'] == OP_SN . '-setup-wizard') {
$cur = op_get_option('theme', 'dir');
if (isset($_GET['theme_switch']) && $_GET['theme_switch'] != $cur && ($conf = op_load_theme_config($_GET['theme_switch'])) !== false) {
$theme = array('name' => $conf['name'], 'screenshot' => $conf['screenshot'], 'screenshot_thumbnail' => $conf['screenshot_thumbnail'], 'description' => $conf['description'], 'dir' => $_GET['theme_switch']);
op_update_option('theme', $theme);
$reinit_theme = true;
}
} elseif ($_GET['page'] == OP_SN . '-page-builder') {
$disable_theme = true;
}
} elseif (defined('DOING_AJAX')) {
$action = '';
if (!($action = op_get('action'))) {
$action = op_post('action');
}
$chk = OP_SN . '-live-editor';
if (is_string($action) && substr($action, 0, strlen($chk)) == $chk) {
$disable_theme = true;
}
}
if ($disable_theme === false) {
op_init_theme();
define('OP_REINIT_THEME', $reinit_theme);
if ($reinit_theme) {
define('OP_SHOW_THEME_MSG', $cur !== false);
do_action(OP_SN . '-reinit_theme');
}
}
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:35,代码来源:init.php
示例2: op_allow_bbforum
function op_allow_bbforum()
{
$forumPage = get_post(url_to_postid("http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']));
if ($forumPage->post_type == 'forum') {
op_update_option('blog_enabled', 'Y');
op_update_option('installed', 'Y');
}
}
开发者ID:OptimizePress,项目名称:op-bbpress-fix,代码行数:8,代码来源:op-bbpress-fix.php
示例3: saveTheme
/**
* Save form data
* @param array $data
* @return void
*/
public function saveTheme($data)
{
// Frontend
op_update_option('op_external_theme_css', op_get_var($data, 'external_theme_css'));
op_update_option('op_external_theme_js', op_get_var($data, 'external_theme_js'));
// Backend
op_update_option('op_le_external_theme_css', op_get_var($data, 'le_external_theme_css'));
op_update_option('op_le_external_theme_js', op_get_var($data, 'le_external_theme_js'));
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:14,代码来源:disable_styles_scripts.php
示例4: authorize
/**
* Authorizes user on GoToWebinar using OAuth
*
* User will be redirected to GoToWebinar website for authorization
*
* @return void
*/
public function authorize()
{
/*
* If 'callback' is defined we are returned from GoToWebinar with auth details
*/
if (false === op_get('disconnect')) {
op_update_option(self::OPTION_NAME_ENABLED, true);
header("HTTP/1.1 200 OK");
header('Location: ' . admin_url() . 'admin.php?page=optimizepress#email_marketing_services--oneshoppingcart');
exit;
} else {
if ('1' == op_get('disconnect')) {
op_delete_option(self::OPTION_NAME_ENABLED);
header("HTTP/1.1 200 OK");
header('Location: ' . admin_url() . 'admin.php?page=optimizepress#email_marketing_services--oneshoppingcart');
exit;
}
}
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:26,代码来源:OneShoppingCart.php
示例5: save_social_integration
function save_social_integration($op)
{
if ($social_integration = op_get_var($op, 'social_integration')) {
op_update_option('social_integration', $social_integration);
}
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:6,代码来源:general.php
示例6: save_typography
function save_typography($op)
{
if (isset($op['typography'])) {
$op = $op['typography'];
$typography = op_get_option('typography');
$typography = is_array($typography) ? $typography : array();
$typography_elements = op_typography_elements();
$typography['font_elements'] = op_get_var($typography, 'font_elements', array());
$typography['color_elements'] = op_get_var($typography, 'font_elements', array());
if (isset($typography_elements['font_elements'])) {
foreach ($typography_elements['font_elements'] as $name => $options) {
$tmp = op_get_var($op, $name, op_get_var($typography['font_elements'], $name, array()));
$typography['font_elements'][$name] = array('size' => op_get_var($tmp, 'size'), 'font' => op_get_var($tmp, 'font'), 'style' => op_get_var($tmp, 'style'), 'color' => op_get_var($tmp, 'color'));
}
}
if (isset($typography_elements['color_elements'])) {
foreach ($typography_elements['color_elements'] as $name => $options) {
$typography['color_elements'][$name] = op_get_var($op, $name, op_get_var($typography['color_elements'], $name, array()));
}
}
op_update_option('typography', $typography);
}
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:23,代码来源:social_integration.php
示例7: save_flowplayer_license
function save_flowplayer_license($op)
{
if (empty($op['flowplayer_license']['custom_logo']) && empty($op['flowplayer_license']['license_key']) && empty($op['flowplayer_license']['js_file']) && empty($op['flowplayer_license']['swf_file'])) {
/*
* If every param is empty, we aren't trying to license flowplayer
*/
op_delete_option('flowplayer_license');
return;
} else {
if (empty($op['flowplayer_license']['license_key']) || empty($op['flowplayer_license']['js_file']) || empty($op['flowplayer_license']['swf_file'])) {
op_group_error('global_settings');
op_section_error('global_settings_flowplayer_license');
op_tpl_error('op_sections_flowplayer_license', __('To remove Flowplayer watermark and/or to use custom logo, license key, HTML5 and Flash commercial version files needs to be present.', OP_SN));
}
}
op_update_option('flowplayer_license', $op['flowplayer_license']);
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:17,代码来源:global_settings.php
示例8: ping
/**
* Ping SL service with API key
* @param string $type
* @param string $version
* @return bool|WP_Error
*/
public function ping($type = null, $version = null)
{
$args = array('headers' => array(self::HEADER_INSTALLATION_URL_PARAM => $this->getInstallationUrl(), self::HEADER_API_KEY_PARAM => $this->getApiKey()), 'body' => array('type' => $type !== null ? $type : OP_TYPE, 'version' => $version !== null ? $version : OP_VERSION, 'php' => phpversion(), 'locale' => get_locale()));
if ($type === null && OP_TYPE === 'plugin') {
$theme = wp_get_theme();
$args['body']['theme'] = $theme->get('Name');
} else {
if ($type === null && OP_TYPE === 'theme') {
$themeNum = op_get_option('theme', 'dir');
// There is no theme selected cause the blog setup wasn't finished
if (empty($themeNum)) {
$themeNum = '0 (not selected)';
}
$args['body']['theme'] = 'OptimizePress #' . $themeNum;
}
}
$args['body']['optin_stats_current'] = op_optin_stats_get_local_month_count('current');
$args['body']['optin_stats_last'] = op_optin_stats_get_local_month_count('last');
$response = wp_remote_post(base64_decode(self::OP_SL_BASE_URL) . 'ping', $args);
if (is_wp_error($response)) {
/*
* Request failed
*/
$this->log('OP SL error: ' . $response->get_error_message());
return new WP_Error($response->get_error_code(), $response->get_error_message());
} else {
if ((int) $response['response']['code'] !== 200) {
/*
* API key issues
*/
$data = json_decode($response['body']);
$this->log('OP SL error: ' . $data->error);
return new WP_Error('invalid', $data->error);
} else {
/*
* Success
*/
$data = json_decode($response['body']);
// If SL customer data exists we'll save it
if (isset($data->data->customer)) {
op_update_option('sl_customer', (array) $data->data->customer);
}
// If global optin stats exists we'll save it
if (isset($data->data->optin_stats)) {
op_optin_stats_save_global_data($data->data->optin_stats);
}
return true;
}
}
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:56,代码来源:sl_api.php
示例9: save_footer_prefs
function save_footer_prefs($op)
{
$op = op_get_var($op, 'footer_prefs', array());
$footer_prefs = $this->_footer_prefs();
$new_footer_prefs = op_get_option('footer_prefs');
$new_footer_prefs = is_array($new_footer_prefs) ? $new_footer_prefs : array();
if (isset($footer_prefs['columns'])) {
$cols = $footer_prefs['columns'];
$new_footer_prefs['widths'] = array();
$value = op_get_var($op, 'value', $cols['min']);
if ($value < $cols['min']) {
$value = $cols['min'];
}
if ($value > $cols['max']) {
$value = $cols['max'];
}
$new_footer_prefs['value'] = $value;
$max = $cols['max'] + 1;
$widths = op_get_var($op, 'widths', array());
for ($i = 1; $i < $max; $i++) {
$new_footer_prefs['widths'][$i] = op_get_var($widths, $i, 0);
}
}
op_update_option('footer_prefs', $new_footer_prefs);
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:25,代码来源:layout.php
示例10: save_theme
function save_theme()
{
if (isset($_POST['theme_id'])) {
if (op_get_option('theme', 'dir') != $_POST['theme_id'] && ($conf = op_load_theme_config($_POST['theme_id'])) !== false) {
op_update_option('theme', 'dir', $_POST['theme_id']);
wp_redirect(menu_page_url(OP_SN . '-theme-settings', false) . '&theme_switch=' . $_POST['theme_id']);
}
}
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:9,代码来源:theme_settings.php
示例11: save_ontraport
function save_ontraport($op)
{
$appId = op_get_var($op['email_marketing_services'], 'ontraport_app_id');
$apiKey = op_get_var($op['email_marketing_services'], 'ontraport_api_key');
if ($appId) {
op_update_option('ontraport_app_id', $appId);
} else {
op_delete_option('ontraport_app_id');
}
if ($apiKey) {
op_update_option('ontraport_api_key', $apiKey);
} else {
op_delete_option('ontraport_api_key');
}
}
开发者ID:denis-chmel,项目名称:wordpress,代码行数:15,代码来源:email_marketing_services.php
示例12: save_step_4
function save_step_4()
{
$this->save_step(false);
if (!op_has_error()) {
op_update_option('blog_enabled', 'Y');
wp_redirect(menu_page_url(OP_SN . '-setup-wizard', false) . '&step=5');
}
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:8,代码来源:wizard.php
示例13: saveGlobalData
/**
* Save global optin stats.
*
* @param mixed $data
* @return boolean
*/
public function saveGlobalData($data)
{
op_update_option(self::OPTION_GLOBAL_KEY, (array) $data);
$this->globalData = (array) $data;
return true;
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:12,代码来源:optin_stats.php
示例14: save_officeautopilot
function save_officeautopilot($op)
{
$appId = op_get_var($op['email_marketing_services'], 'officeautopilot_app_id');
$apiKey = op_get_var($op['email_marketing_services'], 'officeautopilot_api_key');
if ($appId && $apiKey) {
op_update_option('officeautopilot_app_id', $appId);
op_update_option('officeautopilot_api_key', $apiKey);
}
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:9,代码来源:email_marketing_services.php
示例15: save_analytics_and_tracking
function save_analytics_and_tracking($op)
{
if ($analytics_and_tracking = op_get_var($op, 'analytics_and_tracking')) {
op_update_option('analytics_and_tracking', $analytics_and_tracking);
}
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:6,代码来源:analytics_and_tracking.php
示例16: op_update_trim_option
function op_update_trim_option($name, $value)
{
op_update_option($name, preg_replace("/\\s+/", '', $value));
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:4,代码来源:email_marketing_services.php
示例17: authorize
/**
* Authorizes user on AWeber using OAuth
*
* User will be redirected to AWeber website for authorization
*
* @return void
*/
public function authorize()
{
/*
* If 'callback' is defined we are returned from AWeber with auth details
*/
if (false === op_get('callback') && false === op_get('disconnect')) {
/*
* Defining callback URL where AWeber will return with auth information
*/
$callbackUrl = site_url('/' . OP_AWEBER_AUTH_URL . '?callback=1');
/*
* Fetching request token from AWeber
*/
list($requestToken, $requestTokenSecret) = $this->getClient()->getRequestToken($callbackUrl);
/*
* Saving temp request token secret
*/
op_update_option(self::OPTION_NAME_OAUTH_ACCESS_SECRET, $requestTokenSecret);
/*
* Redirecting to AWeber login/authorization dialog
*/
header("HTTP/1.1 200 OK");
header('Location: ' . $this->getClient()->getAuthorizeUrl());
exit;
} else {
if ('1' == op_get('disconnect')) {
/*
* Saving access data
*/
op_delete_option(self::OPTION_NAME_OAUTH_ACCESS_TOKEN);
op_delete_option(self::OPTION_NAME_OAUTH_ACCESS_SECRET);
/*
* Redirecting user to dashboard page
*/
header("HTTP/1.1 200 OK");
header('Location: ' . admin_url() . 'admin.php?page=optimizepress#email_marketing_services--aweber');
exit;
} else {
/*
* Filling AWeber user with needed information (from GET and from data received in earlier step)
*/
$this->getClient()->user->tokenSecret = op_get_option(self::OPTION_NAME_OAUTH_ACCESS_SECRET);
$this->getClient()->user->requestToken = op_get('oauth_token');
$this->getClient()->user->verifier = op_get('oauth_verifier');
/*
* Fetching access token
*/
list($accessToken, $accessTokenSecret) = $this->getClient()->getAccessToken();
/*
* Saving access data
*/
op_update_option(self::OPTION_NAME_OAUTH_ACCESS_TOKEN, $accessToken);
op_update_option(self::OPTION_NAME_OAUTH_ACCESS_SECRET, $accessTokenSecret);
/*
* Redirecting user to dashboard page
*/
header("HTTP/1.1 200 OK");
header('Location: ' . admin_url() . 'admin.php?page=optimizepress#email_marketing_services--aweber');
exit;
}
}
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:69,代码来源:Aweber.php
示例18: authorize
/**
* Authorizes user on GoToWebinar using OAuth
*
* User will be redirected to GoToWebinar website for authorization
*
* @return void
*/
public function authorize()
{
/*
* If 'callback' is defined we are returned from GoToWebinar with auth details
*/
if (false === op_get('authorize') && false === op_get('disconnect') && false === op_get('clean')) {
/*
* Defining callback URL where GoToWebinar will return with auth information
*/
$callbackUrl = admin_url('admin.php?action=' . OP_GOTOWEBINAR_AUTH_URL);
$response = $this->getClient()->getOAuthToken($this->apiKey, $callbackUrl);
if (is_string($response)) {
$data = json_decode($response);
/*
* Saving access token
*/
op_update_option(self::OPTION_NAME_OAUTH_ACCESS_TOKEN, $data->access_token);
op_update_option(self::OPTION_NAME_OAUTH_ORGANIZER_KEY, $data->organizer_key);
op_update_option(self::OPTION_NAME_OAUTH_EXPIRES_IN, time() + (int) $data->expires_in);
}
/*
* Redirecting to GoToWebinar login/authorization dialog
*/
header("HTTP/1.1 200 OK");
header('Location: ' . admin_url() . 'admin.php?page=optimizepress#email_marketing_services--gotowebinar');
exit;
} else {
if ('1' == op_get('disconnect')) {
/*
* Saving access data
*/
op_delete_option(self::OPTION_NAME_OAUTH_ACCESS_TOKEN);
op_delete_option(self::OPTION_NAME_OAUTH_ORGANIZER_KEY);
op_delete_option(self::OPTION_NAME_OAUTH_EXPIRES_IN);
op_delete_option(self::OPTION_NAME_OAUTH_API_KEY);
/*
* Redirecting user to dashboard page
*/
header("HTTP/1.1 200 OK");
header('Location: ' . admin_url() . 'admin.php?page=optimizepress#email_marketing_services--gotowebinar');
exit;
} else {
if ('1' == op_get('clean')) {
op_delete_option(self::OPTION_NAME_OAUTH_API_KEY);
/*
* Redirecting user to dashboard page
*/
header("HTTP/1.1 200 OK");
header('Location: ' . admin_url() . 'admin.php?page=optimizepress#email_marketing_services--gotowebinar');
exit;
} else {
$callbackUrl = admin_url('admin.php?action=' . OP_GOTOWEBINAR_AUTH_URL);
$this->getClient()->getOAuthToken($this->apiKey, $callbackUrl);
}
}
}
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:64,代码来源:GoToWebinar.php
示例19: set_typography_defaults
function set_typography_defaults()
{
//Get the header preferences
$default_typography = op_default_option('default_typography');
if (!empty($default_typography)) {
//Loop through each of them and set the defaults if not set
foreach ($default_typography['font_elements'] as $key => $cat) {
foreach ($cat as $key2 => $pref) {
//Check to see if this value is empty so we can set the default, if needed
if (empty($pref)) {
//Explode the key so we can see which setting this is for
$key2_array = explode('_', $key2);
//Get the setting by seeing what is the last index of the array
$setting = end($key2_array);
//Check the last index in the array to see which setting this is for
switch ($setting) {
case 'font':
$default_typography['font_elements'][$key][$key2] = 'Source Sans Pro, sans-serif';
break;
case 'size':
if ($key == 'default') {
$default_typography['font_elements'][$key][$key2] = 15;
}
break;
/*case 'style':
$default_typography['font_elements'][$key][$key2] = OP_FONT_STYLE;
break;
case 'spacing':
$default_typography['font_elements'][$key][$key2] = OP_FONT_SPACING;
break;
case 'shadow':
$default_typography['font_elements'][$key][$key2] = OP_FONT_SHADOW;
break;*/
/*case 'style':
$default_typography['font_elements'][$key][$key2] = OP_FONT_STYLE;
break;
case 'spacing':
$default_typography['font_elements'][$key][$key2] = OP_FONT_SPACING;
break;
case 'shadow':
$default_typography['font_elements'][$key][$key2] = OP_FONT_SHADOW;
break;*/
case 'color':
if ($key == 'default') {
$default_typography['font_elements'][$key][$key2] = '###4';
}
break;
}
}
}
}
//Update the default typography settings
op_update_option('default_typography', $default_typography);
}
//Also check the footer defaults
$site_footer = op_default_option('site_footer');
//Set the default font family but only if it is not currently set
$site_footer['font_family'] = !empty($site_footer['font_family']) ? 'Source Sans Pro, sans-serif' : '';
//Update the default footer font settings
op_update_option('site_footer', $site_footer);
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:61,代码来源:install.php
示例20: setApiKey
/**
* Saving API key to WP options table
* @param string $key
* @return void
*/
public function setApiKey($key)
{
op_update_option(self::OPTION_API_KEY_PARAM, $key);
}
开发者ID:denis-chmel,项目名称:wordpress,代码行数:9,代码来源:sl_api.php
注:本文中的op_update_option函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论