'.date_i18n('F', strtotime('01-'.($the_month_num+1).'-2011')).' →'; endif; $sales_heading .= '← '.date_i18n('F', strtotime('01-'.($the_month_num-1).'-2011')).''.__( 'Monthly Sales', 'woocommerce' ).''; if ( current_user_can( 'publish_shop_orders' ) ) { wp_add_dashboard_widget( 'woocommerce_dashboard_right_now', __( 'WooCommerce Right Now', 'woocommerce' ), 'woocommerce_dashboard_widget_right_now' ); wp_add_dashboard_widget( 'woocommerce_dashboard_recent_orders', __( 'WooCommerce Recent Orders', 'woocommerce' ), 'woocommerce_dashboard_recent_orders'); wp_add_dashboard_widget( 'woocommerce_dashboard_recent_reviews', __( 'WooCommerce Recent Reviews', 'woocommerce' ), 'woocommerce_dashboard_recent_reviews' ); } if ( current_user_can( 'view_woocommerce_reports' ) || current_user_can( 'publish_shop_orders' ) ) { //wp_add_dashboard_widget( 'woocommerce_dashboard_sales', $sales_heading, 'woocommerce_dashboard_sales' ); } } /** * WooCommerce Right Now widget. * * Adds a dashboard widget with shop statistics. * * @access public * @return void */ function woocommerce_dashboard_widget_right_now() { global $woocommerce; $product_count = wp_count_posts( 'product' ); $product_cat_count = wp_count_terms( 'product_cat' ); $product_tag_count = wp_count_terms( 'product_tag' ); $product_attr_count = count( $woocommerce->get_helper( 'attribute' )->get_attribute_taxonomies() ); $pending_count = get_term_by( 'slug', 'pending', 'shop_order_status' )->count; $completed_count = get_term_by( 'slug', 'completed', 'shop_order_status' )->count; $on_hold_count = get_term_by( 'slug', 'on-hold', 'shop_order_status' )->count; $processing_count = get_term_by( 'slug', 'processing', 'shop_order_status' )->count; ?>
WooCommerce %s.', 'woocommerce' ), $woocommerce->version ); ?>
' . __( 'There are no product orders yet.', 'woocommerce' ) . '
'; endif; } /** * Recent reviews widget * * @access public * @return void */ function woocommerce_dashboard_recent_reviews() { global $wpdb; $comments = $wpdb->get_results( "SELECT *, SUBSTRING(comment_content,1,100) AS comment_excerpt FROM $wpdb->comments LEFT JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' AND post_type = 'product' ORDER BY comment_date_gmt DESC LIMIT 5" ); if ( $comments ) { echo '' . wp_kses_data( $comment->comment_excerpt ) . ' [...]
' . __( 'There are no product reviews yet.', 'woocommerce' ) . '
'; } }