File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -408,7 +408,7 @@ function create_ad_code( $ad_code = array() ) {
408408 foreach ( $ this ->current_provider ->ad_code_args as $ arg ) {
409409 // We shouldn't create an ad code,
410410 // If any of required fields is not set
411- if ( ! $ ad_code [$ arg ['key ' ]] && $ arg ['required ' ] === true ) {
411+ if ( ! isset ( $ ad_code [$ arg ['key ' ]] ) && $ arg ['required ' ] === true ) {
412412 return new WP_Error ();
413413 }
414414 $ titles [] = $ ad_code [$ arg ['key ' ]];
@@ -438,7 +438,7 @@ function create_ad_code( $ad_code = array() ) {
438438 function edit_ad_code ( $ ad_code_id , $ ad_code = array ()) {
439439 foreach ( $ this ->current_provider ->ad_code_args as $ arg ) {
440440 // If a required argument is not set, we return an error message with the missing parameter
441- if ( ! $ ad_code [$ arg ['key ' ]] && $ arg ['required ' ] === true ) {
441+ if ( ! isset ( $ ad_code [$ arg ['key ' ]] ) && $ arg ['required ' ] === true ) {
442442 return new WP_Error ( 'edit-error ' , 'Error updating ad code, a parameter for ' . esc_html ( $ arg ['key ' ] ) . ' is required. ' );
443443 }
444444 }
You can’t perform that action at this time.
0 commit comments