Return to Snippet

Revision: 46282
at May 16, 2011 22:38 by hugosolar

Initial Code
function select_custom_posts($selected){
		$out.='<select name="'.$this->get_field_name('ctype').'" >';
		$out.='<option value="">Seleccione un tipo</option>';
		  '_builtin' => false
		foreach ($post_types as $post_type ) {
		 	$out.= '<option value="'.$post_type.'" '.$selec.'>'. $post_type. '</option>';
		echo $out;

Initial URL

Initial Description
this creates a function inside a widget object to create a dropdown menu with all the custom post types created in wordpress functions.

Initial Title
Get custom post types inside a wordpress widget

Initial Tags
post, wordpress

Initial Language