/**
 * Create/Update/Delete the product tabs
 *
 * @access public
 * @param int $post_id the post identifier
 * @param object $post the post object
 */
function wc_tab_manager_process_product_meta_tabs_tab($post_id, $post)
{
    global $wp_filter;
    // explanation of post_save action nesting issue:  http://xplus3.net/2011/08/18/wordpress-action-nesting/
    $wp_filter_index = key($wp_filter['save_post']);
    $tabs = wc_tab_manager_process_tabs($post_id, $post);
    reset($wp_filter['save_post']);
    foreach (array_keys($wp_filter['save_post']) as $key) {
        if ($key == $wp_filter_index) {
            break;
        }
        next($wp_filter['save_post']);
    }
    update_post_meta($post_id, '_product_tabs', $tabs);
    // whether the tab layout defined at the product level should be used
    $override_tab_layout = isset($_POST['_override_tab_layout']) && $_POST['_override_tab_layout'] ? 'yes' : 'no';
    update_post_meta($post_id, '_override_tab_layout', $override_tab_layout);
}
/**
 * Save the default tab layout settings
 * @access public
 */
function wc_tab_manager_default_layout_save()
{
    $tabs = wc_tab_manager_process_tabs();
    update_option('wc_tab_manager_default_layout', $tabs);
    return wp_redirect(add_query_arg(array("page" => WC_TAB_MANAGER::PLUGIN_ID, 'result' => 'saved'), admin_url('admin.php')));
}