Merge pull request #4476 from ragulka/check-for-actions
Check for actions before looping over them
This commit is contained in:
commit
85288b9e5f
|
@ -86,8 +86,10 @@ if ( $customer_orders ) : ?>
|
|||
|
||||
$actions = apply_filters( 'woocommerce_my_account_my_orders_actions', $actions, $order );
|
||||
|
||||
foreach ( $actions as $key => $action ) {
|
||||
echo '<a href="' . esc_url( $action['url'] ) . '" class="button ' . sanitize_html_class( $key ) . '">' . esc_html( $action['name'] ) . '</a>';
|
||||
if ($actions) {
|
||||
foreach ( $actions as $key => $action ) {
|
||||
echo '<a href="' . esc_url( $action['url'] ) . '" class="button ' . sanitize_html_class( $key ) . '">' . esc_html( $action['name'] ) . '</a>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
|
Loading…
Reference in New Issue