Skip to content

Instantly share code, notes, and snippets.

/**
* Process meta
*
* Processes the custom tab options when a post is saved
*/
function process_product_meta_custom_tab($post_id) {
update_post_meta($post_id, 'custom_tab_enabled', (isset ($_POST['custom_tab_enabled']) && $_POST['custom_tab_enabled']) ? 'yes' : 'no');
update_post_meta($post_id, 'custom_tab_title', $_POST['custom_tab_title']);
update_post_meta($post_id, 'custom_tab_content', $_POST['custom_tab_content']);
}
@dannyconnolly
dannyconnolly / gist:7673502
Last active December 29, 2015 12:49
Child Menu for Wordpress
<?php
global $wp_query;
if( empty($wp_query->post->post_parent) ) {
$parent = $wp_query->post->ID;
} else {
$parent = array_reverse(get_post_ancestors($post->ID));
$parent = $parent[0];
}
if(wp_list_pages("title_li=&child_of=$parent&echo=0" )) {
?>