3, 'post_type' => array( 'post', 'page' ), 'orderby' => 'modified', ) ); if ( $posts ) { $html .= '

' . __( 'Recently Edited' ) . '

'; $html .= '
'; } } } if ( array_key_exists( 'aqpanel_widgets_button', $aqpanel_options['aqpanel_additional'] ) ) { if ( $aqpanel_options['aqpanel_additional']['aqpanel_widgets_button'] == 1 ) { $url = admin_url( 'widgets.php' ); $html .= '

' . __( 'Widgets' ) . '

'; } } if ( array_key_exists( 'aqpanel_menus_button', $aqpanel_options['aqpanel_additional'] ) ) { if ( $aqpanel_options['aqpanel_additional']['aqpanel_menus_button'] == 1 ) { $url = admin_url( 'nav-menus.php' ); $html .= '

' . __( 'Menus' ) . '

'; } } $html .= '
'; } // Main post list if ( !empty($aqpanel_options['aqpanel_posttypes']) ) { $has_one_or_more = false; foreach ( $aqpanel_options['aqpanel_posttypes'] as $post_type => $value ) { // Do not show products without WooCommerce if ( !class_exists( 'woocommerce' ) && $post_type == 'product' ) { continue; } $icon = ''; switch ( $post_type ) { case 'post': $icon = 'dashicons-admin-post'; break; case 'page': $icon = 'dashicons-admin-page'; break; case 'product': $icon = 'dashicons-admin-post'; break; default: $icon = 'dashicons-admin-post'; break; } $query = new WP_Query( array( 'post_type' => $post_type, 'meta_key' => '_is_aqpanel_featured_post', 'meta_value' => 'yes', ) ); if ( $query->have_posts() ) { $has_one_or_more = true; $html .= '

' . esc_html( $post_type ) . 's

'; $html .= '
'; } wp_reset_query(); } // Featured orders if ( class_exists( 'woocommerce' ) && array_key_exists( 'shop_order', $aqpanel_options['aqpanel_posttypes'] ) ) { if ( $aqpanel_options['aqpanel_posttypes']['shop_order'] == '1' ) { $customer_orders = get_posts( array( 'numberposts' => -1, 'post_type' => 'shop_order', 'meta_key' => '_is_aqpanel_featured_post', 'post_status' => array_keys( wc_get_order_statuses() ), ) ); if ( !empty($customer_orders) ) { $has_one_or_more = true; // Going through each current customer orders $html .= '

' . __( 'Orders' ) . '

'; $html .= ''; $html .= '
'; } } } // Empty message if ( !$has_one_or_more ) { $html .= '
You can add posts here through post list column or through special post meta box.
'; } $html .= ''; } return $html; }