Skip to content

Commit

Permalink
Fix undefined variables (#161)
Browse files Browse the repository at this point in the history
* fix undefined variables

* Handle _referrer_id notice as well
  • Loading branch information
luizbills authored and k1sul1 committed Mar 6, 2019
1 parent ff02906 commit 78ebcf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions inc/wplf-form-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ function wplf_email_maybe_implode_serialized_value( $value, $form_id = 0, $form_

if ( is_array( $value ) ) {
$implode_glue = apply_filters( 'wplf_email_array_field_implode_glue', ', ' );
$implode_glue = apply_filters( "wplf_{$form->post_name}_email_array_field_implode_glue", $implode_glue );
$implode_glue = apply_filters( "wplf_{$form->ID}_email_array_field_implode_glue", $implode_glue );
$implode_glue = apply_filters( "wplf_{$form_name}_email_array_field_implode_glue", $implode_glue );
$implode_glue = apply_filters( "wplf_{$form_id}_email_array_field_implode_glue", $implode_glue );

$value = implode( $implode_glue, $value );
}
Expand Down
3 changes: 2 additions & 1 deletion inc/wplf-form-validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ function wplf_validate_additional_fields( $return ) {
}
}
$additional_fields = array_filter( $additional_fields ); // get rid of the empty keys
$referrer_id = isset( $all_fields['_referrer_id'] ) ? $all_fields['_referrer_id'] : null;

// support archive referrer, do not keep field _referrer_archive_title as a additional field
if ( 'archive' === $all_fields['_referrer_id'] && array_key_exists( '_refererr_archive_title', $additional_fields ) ) {
if ( 'archive' === $referrer_id && array_key_exists( '_refererr_archive_title', $additional_fields ) ) {
unset( $additional_fields['_referrer_archive_title'] );
}

Expand Down

0 comments on commit 78ebcf1

Please sign in to comment.