From: Steve Sutton Date: Thu, 26 Oct 2017 18:26:01 +0000 (-0400) Subject: Fix the request vars being set unless they are true. X-Git-Tag: v1.0.4^2~22 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=4af0b712a91592c3316012149aa2bdb032b7d682;p=WP-Plugins%2Fglm-member-db-fields.git Fix the request vars being set unless they are true. When setting request only do so if the request custom field has value. --- diff --git a/setup/frontHooks.php b/setup/frontHooks.php index 0ea8e83..e0124fd 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -99,7 +99,7 @@ add_filter( 'glm-member-db-front-search-request', function( $actionData ) { foreach ( $customFields as $key => $field ) { // convert name to lower case and replace spaces with _ $field_name = preg_replace( '/[ -]/', '_', strtolower( $field['field_name'] ) ); - if ( isset( $actionData['request'][$field_name] ) ) { + if ( isset( $actionData['request'][$field_name] ) && $actionData['request'][$field_name]) { $_REQUEST[$field_name] = $actionData['request'][$field_name]; } }