20) {
$title = substr($title, 0, 20) . '..';
}
$output = '
';
return $output;
}
add_action('admin_menu', 'custom_post_list_view', 11);
function custom_post_list_view() {
/** Get settings **/
$settings = get_option( 'ampl_settings' );
/*** Get all post types ***/
$post_types = get_post_types();
foreach ($post_types as $post_type) {
/*** If enabled in settings ***/
if($settings['post_types'][$post_type] == 'on' ) {
/* Get display options */
$max_limit = $settings['max_limit'][$post_type];
if($max_limit=='') $max_limit = 0;
$post_orderby = $settings['orderby'][$post_type];
if($post_orderby=='') $post_orderby = 'date';
$post_order = $settings['order'][$post_type];
if($post_order=='') $post_order = 'ASC';
$post_exclude = $settings['exclude_status'][$post_type];
if($post_exclude=='') $post_exclude = 'off';
if($post_exclude=='on') {
$post_exclude = 'publish';
} else {
$post_exclude = 'any';
}
$custom_menu_slug = $post_type;
$output = '';
$args = array(
"post_type" => $post_type,
"parent" => "0",
"post_parent" => "0",
"numberposts" => "-1",
"orderby" => $post_orderby,
"order" => $post_order,
"post_status" => $post_exclude,
"suppress_filters" => 0
);
$posts = get_posts($args);
if($posts) {
$output .= '';
$output .= ''
. '
' . '
' . '';
$count=0;
foreach ($posts as $post) {
if(($max_limit==0) ||
($count<$max_limit))
$output .= build_post_list_item($post->ID,$post_type,'parent');
$count++;
}
$output .= '
';
$output .= '