true ) ) ); } } add_action('after_switch_theme', 'botiga_hf_enable_to_new_users'); /** * Header/Footer Update Notice * * @since 1.1.9 * */ function botiga_hf_update_notice_1_1_9() { if ( get_option( 'botiga-update-hf-dismiss' ) ) { return; } if ( !get_option( 'botiga-update-hf' ) ) { ?>
true ) ) ); wp_send_json( array( 'success' => true ) ); } add_action( 'wp_ajax_botiga_hf_update_notice_1_1_9_callback', 'botiga_hf_update_notice_1_1_9_callback' ); /** * Header update ajax callback * * @since 1.1.9 */ function botiga_hf_update_dismiss_notice_1_1_9_callback() { check_ajax_referer( 'botiga-update-hf-dismiss-nonce', 'nonce' ); update_option( 'botiga-update-hf-dismiss', true ); wp_send_json( array( 'success' => true ) ); } add_action( 'wp_ajax_botiga_hf_update_dismiss_notice_1_1_9_callback', 'botiga_hf_update_dismiss_notice_1_1_9_callback' ); /** * Migrate 'header transparent' and 'header image' old display conditions to the new. * Migrate scroll to top offsets. * * @since 1.2.1 */ function botiga_migrate_1_2_1_options() { $flag = get_theme_mod( 'botiga_migrate_1_2_1_options_flag', false ); if ( true === $flag ) { return; } // Scroll To Top Offsets set_theme_mod( 'scrolltop_side_offset_desktop', get_theme_mod( 'scrolltop_side_offset', 30 ) ); set_theme_mod( 'scrolltop_bottom_offset_desktop', get_theme_mod( 'scrolltop_bottom_offset', 30 ) ); // Header Transparent $header_transparent_display_on = get_theme_mod( 'header_transparent_display_on', 'front-page' ); $values = explode( ',', $header_transparent_display_on ); $new_value = array(); foreach( $values as $val ) { if( $val === 'pages' ) { $val = 'single-page'; } if( $val === 'blog-archive' ) { $val = 'post-archives'; } if( $val === 'blog-posts' ) { $val = 'single-post'; } if( $val === 'post-search' ) { $val = 'search'; } $new_value[] = array( 'type' => 'include', 'condition' => $val, 'id' => null ); } set_theme_mod( 'header_transparent_display_on', json_encode( $new_value ) ); // Header Image $show_header_image_only_home = get_theme_mod( 'show_header_image_only_home', 0 ); if( $show_header_image_only_home ) { set_theme_mod( 'header_image_display_conditions', json_encode( array( array( 'type' => 'include', 'condition' => 'front-page', 'id' => null ) ) ) ); } else { set_theme_mod( 'header_image_display_conditions', json_encode( array( array( 'type' => 'include', 'condition' => 'all', 'id' => null ) ) ) ); } //Set flag set_theme_mod( 'botiga_migrate_1_2_1_options_flag', true ); } add_action( 'init', 'botiga_migrate_1_2_1_options' );