本文整理汇总了PHP中remove_theme_mod函数的典型用法代码示例。如果您正苦于以下问题:PHP remove_theme_mod函数的具体用法?PHP remove_theme_mod怎么用?PHP remove_theme_mod使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remove_theme_mod函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_attachment_data
/**
* Reset the custom logo if the current logo is deleted in the media manager.
*
* @since 4.5.0
* @access public
*
* @param int $post_id Post ID.
*/
public function delete_attachment_data($post_id)
{
$custom_logo_id = get_theme_mod('custom_logo');
if ($custom_logo_id && $custom_logo_id == $post_id) {
remove_theme_mod('custom_logo');
}
}
示例2: admin_sanitize
/**
* Main Sanitization callback
*/
function admin_sanitize($options)
{
// Get the option array and for each one save as a theme_mod
if (is_array($options) && !empty($options)) {
foreach ($options as $key => $value) {
if (!empty($value)) {
set_theme_mod($key, $value);
} else {
remove_theme_mod($key, $value);
}
}
}
// Save checkboxes
$checkboxes = array('minify_js', 'remove_scripts_version', 'cleanup_head', 'image_resizing', 'remove_posttype_slugs', 'post_series_enable', 'custom_404_enable', 'custom_admin_login_enable', 'custom_css_enable', 'widget_areas_enable', 'skins_enable', 'visual_composer_theme_mode', 'extend_visual_composer', 'favicons_enable', 'trim_custom_excerpts');
// Add post type settings to checkboxes array
$post_types = wpex_theme_post_types();
foreach ($post_types as $post_type) {
$checkboxes[] = $post_type . '_enable';
}
// Loop through all options and check if isset and if so save mod
foreach ($checkboxes as $checkbox) {
// Set theme mod to on
if (isset($options[$checkbox])) {
set_theme_mod($checkbox, true);
} else {
set_theme_mod($checkbox, false);
}
}
// Display notice after saving
add_settings_error('wpex_tweaks_notices', esc_attr('settings_updated'), __('Settings saved.', 'wpex'), 'updated');
// Remove options, everything should live in the theme mods
$options = '';
return $options;
}
示例3: update
function update()
{
// Manage the uploaded picture
if (!empty($_FILES['image_upload']['name']) and !empty($_FILES['image_upload']['size'])) {
move_uploaded_file($_FILES['image_upload']['tmp_name'], K2_HEADERS_PATH . $_FILES['image_upload']['name']);
if (isset($_POST['upload_activate'])) {
update_option('k2header_picture', $_FILES['image_upload']['name']);
}
}
if (!empty($_POST['k2'])) {
// Random Image
if (isset($_POST['k2']['imagerandomfeature'])) {
update_option('k2imagerandomfeature', '1');
} else {
update_option('k2imagerandomfeature', '0');
}
// Header Image
if (isset($_POST['k2']['header_picture'])) {
update_option('k2header_picture', $_POST['k2']['header_picture']);
// Update Custom Image Header
if (function_exists('set_theme_mod')) {
if (empty($_POST['k2']['header_picture'])) {
remove_theme_mod('header_image');
} else {
set_theme_mod('header_image', get_k2info('headers_url') . get_option('k2header_picture'));
}
}
}
}
}
示例4: web_dorado_theme_update_and_get_options_general_settings
public function web_dorado_theme_update_and_get_options_general_settings()
{
if (isset($_GET['page']) && $_GET['page'] == "web_dorado_theme" && isset($_GET['controller']) && $_GET['controller'] == "general_page") {
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'save') {
foreach ($this->options_generalsettings as $value) {
if (isset($_REQUEST[$value['var_name']])) {
$sanitize_type = 'exclusive_do_nothing';
if (isset($value['sanitize_type']) && $value['sanitize_type']) {
$sanitize_type = $value['sanitize_type'];
}
set_theme_mod($value['id'], $sanitize_type($_REQUEST[$value['var_name']]));
} else {
remove_theme_mod($value['id']);
}
}
header("Location: admin.php?page=web_dorado_theme&controller=general_page&saved=true");
die;
} else {
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'reset') {
foreach ($this->options_generalsettings as $value) {
remove_theme_mod($value['id']);
}
header("Location: admin.php?page=web_dorado_theme&controller=general_page&reset=true");
die;
}
}
}
}
示例5: set_top_menu_on_import
function set_top_menu_on_import()
{
$menu_seted = get_option('menus_seted');
if (false == $menu_seted) {
$menu_seted = 0;
}
if (2 >= get_option('menus_seted')) {
$menus = get_terms('nav_menu');
$menu_seted++;
$save = array();
foreach ($menus as $menu) {
if ($menu->name == 'Shop menu') {
$save['shop_menu'] = $menu->term_id;
} elseif ($menu->name == 'Header Menu') {
$save['header_menu'] = $menu->term_id;
} elseif ($menu->name == 'Footer Menu') {
$save['footer_menu'] = $menu->term_id;
}
}
if ($save) {
remove_theme_mod('nav_menu_locations');
set_theme_mod('nav_menu_locations', array_map('absint', $save));
}
update_option('menus_seted', $menu_seted);
}
}
示例6: pagelines_theme_clear_update_transient
/**
* TODO Document!
*/
function pagelines_theme_clear_update_transient()
{
delete_transient(EXTEND_UPDATE);
remove_action('admin_notices', array(&$this, 'pagelines_theme_update_nag'));
delete_transient('pagelines_sections_cache');
remove_theme_mod('pending_updates');
}
示例7: web_dorado_theme_update_and_get_options_home
public function web_dorado_theme_update_and_get_options_home()
{
if (isset($_GET['page']) && $_GET['page'] == "web_dorado_theme" && isset($_GET['controller']) && $_GET['controller'] == "home_page") {
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'save') {
foreach ($this->options_homepage as $value) {
if (isset($_REQUEST[$value['var_name']])) {
set_theme_mod($value['id'], $_REQUEST[$value['var_name']]);
}
}
foreach ($this->options_homepage as $value) {
if (isset($_REQUEST[$value['var_name']])) {
set_theme_mod($value['id'], $_REQUEST[$value['var_name']]);
} else {
remove_theme_mod($value['id']);
}
}
header("Location: themes.php?page=web_dorado_theme&controller=home_page&saved=true");
die;
} else {
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'reset') {
foreach ($this->options_homepage as $value) {
remove_theme_mod($value['id']);
}
header("Location: themes.php?page=web_dorado_theme&controller=home_page&reset=true");
die;
}
}
}
}
示例8: listen
private static function listen()
{
if ($key = filter_input(INPUT_GET, self::PURGE_QUERY_VAR)) {
$response = new stdClass();
if ($key === self::get_purge_key()) {
delete_transient(EXTEND_UPDATE);
delete_transient('pagelines_extend_themes');
delete_transient('pagelines_extend_sections');
delete_transient('pagelines_extend_plugins');
delete_transient('pagelines_extend_integrations');
delete_transient('pagelines_sections_cache');
remove_theme_mod('available_updates');
remove_theme_mod('pending_updates');
do_action('extend_flush');
$response->status = 'success';
$response->message = 'Cache purged.';
$status_code = 200;
} else {
$response->status = 'fail';
$response->message = 'Invalid key.';
$status_code = 422;
}
if (!headers_sent()) {
nocache_headers();
@header("Content-type: application/json");
status_header($status_code);
echo json_encode($response);
exit;
} else {
wp_die($response->message, $response->status, array('response' => $status_code));
}
// silence
}
}
示例9: web_dorado_theme_update_slider
private function web_dorado_theme_update_slider()
{
$image_list = '';
$image_href = '';
$image_title = '';
$image_textarea = '';
$image_link = '';
$ct_pause_on_hover = '';
$ct_hide_slider = '';
if (isset($_POST['ct_pause_on_hover'])) {
$ct_pause_on_hover = $_POST['ct_pause_on_hover'];
}
if (isset($_POST['ct_hide_slider'])) {
$ct_hide_slider = $_POST['ct_hide_slider'];
}
if (isset($_GET['saved']) && $_GET['saved'] == 'saved') {
for ($i = 0; $i < 200; $i++) {
if (isset($_POST['ct_image_link_' . $i])) {
$image_link .= $_POST['ct_image_link_' . $i] . ';;;;';
}
if (isset($_POST['ct_image_href_' . $i])) {
$image_href .= $_POST['ct_image_href_' . $i] . ';;;;';
}
if (isset($_POST['ct_image_title_' . $i])) {
$image_title .= $_POST['ct_image_title_' . $i] . ';;;;';
}
if (isset($_POST['ct_image_textarea_' . $i])) {
$image_textarea .= $_POST['ct_image_textarea_' . $i] . ';;;;';
}
}
set_theme_mod('web_busines_image_link', $image_link);
set_theme_mod('web_busines_image_href', $image_href);
set_theme_mod('web_busines_image_textarea', $image_textarea);
set_theme_mod('web_busines_image_title', $image_title);
set_theme_mod('ct_slider_height', $_POST['ct_slider_height']);
set_theme_mod('ct_pause_time', $_POST['ct_pause_time']);
set_theme_mod('ct_anim_speed', $_POST['ct_anim_speed']);
set_theme_mod('ct_effect', $_POST['ct_effect']);
set_theme_mod('ct_pause_on_hover', $ct_pause_on_hover);
set_theme_mod('ct_hide_slider', $ct_hide_slider);
set_theme_mod('ct_slider_title_position', $_POST['ct_slider_title_position']);
set_theme_mod('ct_slider_description_position', $_POST['ct_slider_description_position']);
}
if (isset($_GET['reset']) && $_GET['reset'] == 'reset') {
remove_theme_mod('web_busines_image_link');
remove_theme_mod('web_busines_image_href');
remove_theme_mod('web_busines_image_title');
remove_theme_mod('web_busines_image_textarea');
remove_theme_mod('ct_slider_height');
remove_theme_mod('ct_pause_time');
remove_theme_mod('ct_anim_speed');
remove_theme_mod('ct_effect');
remove_theme_mod('ct_pause_on_hover');
remove_theme_mod('ct_hide_slider');
remove_theme_mod('ct_slider_title_position');
remove_theme_mod('ct_slider_description_position');
}
}
示例10: sanitize
/**
* Sanitization callback
*/
public function sanitize($options)
{
$skin = !empty($options) ? $options : 'base';
if ('base' == $skin) {
remove_theme_mod('theme_skin');
} else {
set_theme_mod('theme_skin', $skin);
}
$options = '';
}
示例11: siteorigin_panels_transfer_home_page
/**
* Transfer theme data into new settings
*/
function siteorigin_panels_transfer_home_page()
{
if (get_option('siteorigin_panels_home_page', false) === false && get_theme_mod('panels_home_page', false) !== false) {
// Transfer settings from theme mods into settings
update_option('siteorigin_panels_home_page', get_theme_mod('panels_home_page', false));
update_option('siteorigin_panels_home_page_enabled', get_theme_mod('panels_home_page_enabled', false));
// Remove the theme mod data
remove_theme_mod('panels_home_page');
remove_theme_mod('panels_home_page_enabled');
}
}
示例12: flush_caches
function flush_caches()
{
delete_transient(EXTEND_UPDATE);
delete_transient('pagelines_extend_themes');
delete_transient('pagelines_extend_sections');
delete_transient('pagelines_extend_plugins');
delete_transient('pagelines_extend_integrations');
delete_transient('pagelines_sections_cache');
remove_theme_mod('available_updates');
remove_theme_mod('pending_updates');
}
示例13: g_set_theme_mods
/**
* Set / remove theme mods to suit this theme after activation
* @return void
*/
function g_set_theme_mods()
{
// Reset certain theme settings from the db
remove_theme_mod('sd_header_layout');
remove_theme_mod('sd_button_flat');
remove_theme_mod('sd_button_shadows');
remove_theme_mod('sd_button_background_style');
remove_theme_mod('sd_button_rounded');
remove_theme_mod('sd_button_size');
remove_theme_mod('storefront_footer_background_color');
}
示例14: customizer_library_remove_theme_mods
/**
* Helper function to remove custom theme mods
*
* @since 1.0.0
*
* @param string
* @return mixed $default
*/
function customizer_library_remove_theme_mods()
{
$customizer_library = Customizer_Library::Instance();
$options = $customizer_library->get_options();
if ($options) {
foreach ($options as $option) {
if (isset($option['id'])) {
remove_theme_mod($option['id']);
}
}
}
}
示例15: boutique_set_theme_mods
/**
* Set / remove theme mods to suit this theme after activation
* @return void
*/
function boutique_set_theme_mods()
{
// Reset the homepage template product toggles / titles
remove_theme_mod('swc_homepage_recent');
remove_theme_mod('swc_homepage_recent_products_title');
remove_theme_mod('swc_homepage_featured');
remove_theme_mod('swc_homepage_featured_products_title');
remove_theme_mod('swc_homepage_top_rated');
remove_theme_mod('swc_homepage_top_rated_products_title');
remove_theme_mod('swc_homepage_on_sale');
remove_theme_mod('swc_homepage_on_sale_products_title');
}