function wvrx_ts_save_post_fields($post_id)
{
    $default_post_fields = array('_pp_category', '_pp_tag', '_pp_onepost', '_pp_orderby', '_pp_sort_order', '_pp_author', '_pp_posts_per_page', '_pp_primary-widget-area', '_pp_secondary-widget-area', '_pp_sidebar_width', '_pp_top-widget-area', '_pp_bottom-widget-area', '_pp_sitewide-top-widget-area', '_pp_sitewide-bottom-widget-area', '_pp_post_type', '_pp_hide_page_title', '_pp_hide_site_title', '_pp_hide_menus', '_pp_hide_header_image', '_pp_hide_footer', '_pp_hide_header', '_pp_hide_sticky', '_pp_force_post_full', '_pp_force_post_excerpt', '_pp_show_post_avatar', '_pp_bodyclass', '_pp_fi_link', '_pp_fi_location', '_pp_post_fi_location', '_pp_post_styles', '_pp_hide_top_post_meta', '_pp_hide_bottom_post_meta', '_pp_stay_on_page', '_pp_hide_on_menu', '_pp_show_featured_img', '_pp_hide_infotop', '_pp_hide_infobottom', '_pp_hide_visual_editor', '_pp_masonry_span2', '_show_post_bubble', '_pp_hide_post_title', '_pp_post_add_link', '_pp_hide_post_format_label', '_pp_page_layout', '_pp_wvrx_pwp_type', '_pp_wvrx_pwp_cols', '_pp_post_filter', '_pp_header-widget-area', '_pp_footer-widget-area', '_pp_hide_page_infobar', '_pp_hide_n_posts', '_pp_fullposts', '_pp_pwp_masonry', '_pp_pwp_compact', '_pp_pwp_compact_posts', '_primary-widget-area', '_secondary-widget-area', '_header-widget-area', '_footer-widget-area', '_sitewide-top-widget-area', '_sitewide-bottom-widget-area', '_page-top-widget-area', '_page-bottom-widget-area', '_pp_full_browser_height', '_pp_page_cols', '_pp_bgcolor', '_pp_color', '_pp_bg_fullwidth', '_pp_lr_padding', '_pp_tb_padding', '_pp_margin', '_pp_post_class', '_pp_bgimg', '_pp_mobile_bgimg', '_pp_parallax_height', '_pp_use_parallax', '_pp_parallax_not_wide', '_pp_footer_add_class', '_pp_container_add_class', '_pp_content_add_class', '_pp_post_add_class', '_pp_infobar_add_class', '_pp_wrapper_add_class', '_pp_header_add_class', '_pp_header_image_html_text');
    if (weaverx_allow_multisite()) {
        array_push($default_post_fields, '_pp_raw_html');
    }
    $all_post_fields = $default_post_fields;
    if (isset($_POST['post_meta'])) {
        foreach ($all_post_fields as $post_field) {
            if (isset($_POST[$post_field])) {
                $data = $_POST[$post_field];
                if ($post_field != '_pp_post_styles') {
                    $data = stripslashes($data);
                }
                // passed via post, so strip slashes
                if (get_post_meta($post_id, $post_field) == '') {
                    add_post_meta($post_id, $post_field, weaverx_filter_textarea($data), true);
                } else {
                    if ($data != get_post_meta($post_id, $post_field, true)) {
                        update_post_meta($post_id, $post_field, weaverx_filter_textarea($data));
                    } else {
                        if ($data == '') {
                            delete_post_meta($post_id, $post_field, get_post_meta($post_id, $post_field, true));
                        }
                    }
                }
            } else {
                delete_post_meta($post_id, $post_field, get_post_meta($post_id, $post_field, true));
            }
        }
    }
}
function weaverx_adv_head_section()
{
    ?>
<div class="atw-option-header"><span style="color:black; padding:.2em;" class="dashicons dashicons-screenoptions"></span>
<?php 
    _e('The Site &lt;HEAD&gt; Section', 'weaver-xtreme');
    weaverx_help_link('help.html#HeadSection', __('Help for site HEAD section', 'weaver-xtreme'));
    ?>
</div><br />
<p>
<?php 
    _e('This tab allows you to add HTML to the &lt;HEAD&gt; Section of every page on your site.', 'weaver-xtreme');
    ?>
</p>
<?php 
    if (weaverx_allow_multisite()) {
        ?>
<p><small>
<?php 
        _e('PLEASE NOTE: Only minimal validation is made on the field values, so be careful not to use invalid code. Invalid code is usually harmless, but it can make your site display incorrectly. If your site looks broken after make changes here, please double check that what you entered uses valid HTML or CSS rules.', 'weaver-xtreme');
        ?>
</small></p>


	<!-- ======== -->

<br /><br />
<a name="headsection" id="headsection"></a>
<div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-screenoptions"></span>
<?php 
        _e('&lt;HEAD&gt; Section', 'weaver-xtreme');
        ?>
</div>
<br/>
<p>
<?php 
        _e('This input area allows you to enter allowed HTML head elements to the &lt;head&gt; section, including &lt;title&gt;, &lt;base&gt;, &lt;link&gt;, &lt;meta&gt;, and &lt;style&gt;.
Code entered into this box is included right before the &lt;/head&gt; HTML tag on each page of your site.
This code may <strong>not</strong> include <em>&lt;script&gt;s</em> unless you\'ve installed the Weaver Xtreme Theme Support plugin.
We recommend using dedicated WordPress plugins to add things like ad tracking, SEO tags, Facebook code, and so on.
<small>Note: You can add CSS Rules using the "Custom CSS Rules" option on the Main Options tab.', 'weaver-xtreme') . '</small>';
        ?>
</p>
<p>
<?php 
        _e('For even greater control of how your site looks, you can add code the the &lt;HEAD&gt; section on a per page basis using the per page options from the page editor.', 'weaver-xtreme');
        ?>
</p>
<?php 
        weaverx_textarea(weaverx_getopt('head_opts'), 'head_opts', 2, '<!-- HTML code -->', $style = 'width:95%;', $class = 'wvrx-edit');
        ?>
<br>
<small><?php 
        _e('Weaver Xtreme will <em>always</em> load the jQuery Library.', 'weaver-xtreme');
        ?>
</small>
	<!-- ===================================================== -->
<br /><br />

<a name="headsection" id="headsection"></a>
<div class="atw-option-subheader"><span style="color:black; padding:.2em;" class="dashicons dashicons-screenoptions"></span>
<?php 
        _e('&lt;HEAD&gt; Section (Advanced Alternative - &diams;)', 'weaver-xtreme');
        ?>
</div>

<p><small>
<?php 
        _e('Same as normal &lt;HEAD&gt; box above, but works like other &diams; options - it survives changing
the subtheme from the Weaver Xtreme Subthemes tab, and is saved only on a full backup Save.
This option is not commonly used, and is intended for more advanced Weaver Xtreme users.', 'weaver-xtreme');
        ?>
</small></p>
<?php 
        weaverx_textarea(weaverx_getopt('_althead_opts'), '_althead_opts', 2, '<!-- HTML code -->', $style = 'width:95%;', $class = 'wvrx-edit');
        do_action('weaverxplus_admin', 'head_section');
    }
    // not multisite
}