Check if the endpoints array key is set and not empty.

For some reasons in a client's website, I've found that "order-pay" is set but is empty (even if in the backoffice the variable is written in the endpoint's form). So, it is better to check with !empty, doesn't it?
This commit is contained in:
Mauro Mascia 2015-11-22 20:00:59 +01:00
parent 3b5f2710e7
commit 5a95bcf185
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ function wc_get_endpoint_url( $endpoint, $value = '', $permalink = '' ) {
$permalink = get_permalink();
// Map endpoint to options
$endpoint = isset( WC()->query->query_vars[ $endpoint ] ) ? WC()->query->query_vars[ $endpoint ] : $endpoint;
$endpoint = !empty( WC()->query->query_vars[ $endpoint ] ) ? WC()->query->query_vars[ $endpoint ] : $endpoint;
$value = ( 'edit-address' == $endpoint ) ? wc_edit_address_i18n( $value ) : $value;
if ( get_option( 'permalink_structure' ) ) {