本文整理汇总了PHP中op_update_option函数的典型用法代码示例。如果您正苦于以下问题:PHP op_update_option函数的具体用法?PHP op_update_option怎么用?PHP op_update_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了op_update_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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');
}
}
}
示例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');
}
}
示例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'));
}
示例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;
}
}
}
示例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);
}
}
示例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);
}
}
示例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']);
}
示例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;
}
}
}
示例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);
}
示例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']);
}
}
}
示例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');
}
}
示例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');
}
}
示例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;
}
示例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);
}
}
示例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);
}
}