Merge pull request #4476 from ragulka/check-for-actions

Check for actions before looping over them
This commit is contained in:
Mike Jolley 2014-01-09 02:54:48 -08:00
commit 85288b9e5f
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>