Check for actions before looping over them

This commit is contained in:
Illimar Tambek 2014-01-09 12:13:57 +02:00
parent 3671eabd13
commit 3fc62123a7
1 changed files with 4 additions and 2 deletions

View File

@ -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>