Return to Snippet

Revision: 64272
at July 18, 2013 22:08 by larscmagnusson


Initial Code
#### Submeny, användare WordPress wp_nav_menu Filter
	function get_page_or_parent_page_id(){
		global $post;
		
		if($post->post_parent)
			return $post->post_parent;
		else
			return $post->ID;
	}
	function has_subpages(){
		return strlen(wp_list_pages(array("child_of"=>get_page_or_parent_page_id(), "echo" => false))) > 0;
	}

Initial URL


Initial Description


Initial Title
get page or parent page id

Initial Tags
wordpress

Initial Language
PHP