term_id; }else{ global $post; if(isset($post->ID)) $current_id = $post->ID; else $current_id = false; } return $current_id; } } //Custom function to do some cleanup on nested shortcodes //Used for columns and layout-related shortcodes if(!function_exists('cpotheme_do_shortcode')){ function cpotheme_do_shortcode($content){ $content = do_shortcode(shortcode_unautop($content)); $content = preg_replace('#^<\/p>|^|

$|

\s*( )?\s*<\/p>#', '', $content); return $content; } } add_action('after_switch_theme', 'cpotheme_rewrite_flush'); function cpotheme_rewrite_flush(){ flush_rewrite_rules(); }