Merge pull request #23236 from woocommerce/fix/23219

Added is-active class to Orders when looking at individual order
This commit is contained in:
Mike Jolley 2019-04-18 11:22:11 +01:00 committed by GitHub
commit 5c91dac198
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 5 deletions

View File

@ -61,7 +61,8 @@ function wc_customer_edit_account_url() {
*/
function wc_edit_address_i18n( $id, $flip = false ) {
$slugs = apply_filters(
'woocommerce_edit_address_slugs', array(
'woocommerce_edit_address_slugs',
array(
'billing' => sanitize_title( _x( 'billing', 'edit-address-slug', 'woocommerce' ) ),
'shipping' => sanitize_title( _x( 'shipping', 'edit-address-slug', 'woocommerce' ) ),
)
@ -148,6 +149,8 @@ function wc_get_account_menu_item_classes( $endpoint ) {
$current = isset( $wp->query_vars[ $endpoint ] );
if ( 'dashboard' === $endpoint && ( isset( $wp->query_vars['page'] ) || empty( $wp->query_vars ) ) ) {
$current = true; // Dashboard is not an endpoint, so needs a custom check.
} elseif ( 'orders' === $endpoint && isset( $wp->query_vars['view-order'] ) ) {
$current = true; // When looking at individual order, highlight Orders list item (to signify where in the menu the user currently is).
}
if ( $current ) {
@ -186,7 +189,8 @@ function wc_get_account_endpoint_url( $endpoint ) {
*/
function wc_get_account_orders_columns() {
$columns = apply_filters(
'woocommerce_account_orders_columns', array(
'woocommerce_account_orders_columns',
array(
'order-number' => __( 'Order', 'woocommerce' ),
'order-date' => __( 'Date', 'woocommerce' ),
'order-status' => __( 'Status', 'woocommerce' ),
@ -207,7 +211,8 @@ function wc_get_account_orders_columns() {
*/
function wc_get_account_downloads_columns() {
$columns = apply_filters(
'woocommerce_account_downloads_columns', array(
'woocommerce_account_downloads_columns',
array(
'download-product' => __( 'Product', 'woocommerce' ),
'download-remaining' => __( 'Downloads remaining', 'woocommerce' ),
'download-expires' => __( 'Expires', 'woocommerce' ),
@ -231,7 +236,8 @@ function wc_get_account_downloads_columns() {
*/
function wc_get_account_payment_methods_columns() {
return apply_filters(
'woocommerce_account_payment_methods_columns', array(
'woocommerce_account_payment_methods_columns',
array(
'method' => __( 'Method', 'woocommerce' ),
'expires' => __( 'Expires', 'woocommerce' ),
'actions' => ' ',
@ -247,7 +253,8 @@ function wc_get_account_payment_methods_columns() {
*/
function wc_get_account_payment_methods_types() {
return apply_filters(
'woocommerce_payment_methods_types', array(
'woocommerce_payment_methods_types',
array(
'cc' => __( 'Credit card', 'woocommerce' ),
'echeck' => __( 'eCheck', 'woocommerce' ),
)