actions hook for buttons. Closes #2074.
This commit is contained in:
parent
5f47f5e3c9
commit
2b4c428414
|
@ -66,15 +66,26 @@ if ( $customer_orders ) : ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="order-actions" style="text-align:right; white-space:nowrap;">
|
<td class="order-actions" style="text-align:right; white-space:nowrap;">
|
||||||
|
<?php
|
||||||
|
$actions = array();
|
||||||
|
|
||||||
<?php if ( in_array( $order->status, array( 'pending', 'failed' ) ) ) : ?>
|
if ( in_array( $order->status, array( 'pending', 'failed' ) ) )
|
||||||
|
$actions[] = array(
|
||||||
|
'url' => $order->get_checkout_payment_url(),
|
||||||
|
'name' => __( 'Pay', 'woocommerce' )
|
||||||
|
);
|
||||||
|
|
||||||
<a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e( 'Pay', 'woocommerce' ); ?></a>
|
$actions[] = array(
|
||||||
|
'url' => add_query_arg( 'order', $order->id, get_permalink( woocommerce_get_page_id( 'view_order' ) ) ),
|
||||||
|
'name' => __( 'View', 'woocommerce' )
|
||||||
|
);
|
||||||
|
|
||||||
<?php endif; ?>
|
$actions = apply_filters( 'woocommerce_my_account_my_orders_actions', $actions, $order );
|
||||||
|
|
||||||
<a href="<?php echo esc_url( add_query_arg('order', $order->id, get_permalink( woocommerce_get_page_id( 'view_order' ) ) ) ); ?>" class="button"><?php _e( 'View', 'woocommerce' ); ?></a>
|
|
||||||
|
|
||||||
|
foreach( $actions as $action ) {
|
||||||
|
echo '<a href="' . esc_url( $action['url'] ) . '" class="button ' . sanitize_title( $action['name'] ) . '">' . esc_html( $action['name'] ) . '</a>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr><?php
|
</tr><?php
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue