actions hook for buttons. Closes #2074.
This commit is contained in:
parent
5f47f5e3c9
commit
2b4c428414
|
@ -66,15 +66,26 @@ if ( $customer_orders ) : ?>
|
|||
<?php endif; ?>
|
||||
</td>
|
||||
<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; ?>
|
||||
|
||||
<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>
|
||||
$actions = apply_filters( 'woocommerce_my_account_my_orders_actions', $actions, $order );
|
||||
|
||||
foreach( $actions as $action ) {
|
||||
echo '<a href="' . esc_url( $action['url'] ) . '" class="button ' . sanitize_title( $action['name'] ) . '">' . esc_html( $action['name'] ) . '</a>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr><?php
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue