'; if ( !empty($aqpanel_options['aqpanel_posttypes']) ){ $has_one_or_more = false; foreach ( $aqpanel_options['aqpanel_posttypes'] as $post_type => $value ) { $query = new WP_Query( array( 'post_type' => $post_type , 'meta_key' => '_is_aqpanel_featured_post', 'meta_value' => 'yes' ) ); /*echo '
';
					print_r( $query );
					echo '
';*/ if ( $query->have_posts() ){ $has_one_or_more = true; $html .= '

'.esc_html( $post_type ).'s

'; while ( $query->have_posts() ) { $query->the_post(); $id = get_the_ID(); $url = wp_nonce_url( admin_url( 'admin-ajax.php?action=aqpanel_featured_posts&post='.$id.'&aqpanel_featured=no'), 'aqpanel-featured-post' ); $html .='
'; $html .= ''.get_the_post_thumbnail( $id, 'thumbnail' ).''; $html .=''.get_the_title().'
'; } } wp_reset_query(); } if ( ! $has_one_or_more ) { $html .= 'Your Quick Panel is empty. You can add posts here through post list column or through special post meta box.'; } } $html .='
'; echo $html; } /** * Add closed class to admin body */ public function filter_admin_body_class( $array ) { $aqpanel_closed = ''; if ( get_user_setting( 'aqpanel_collapsed' ) == 'true' ) { $aqpanel_closed = ' aqpanel-closed'; } return "$array".$aqpanel_closed; } } endif; if ( class_exists( 'Admin_Quick_Panel_Panel', false ) ) { return new Admin_Quick_Panel_Panel(); }