Skip to content

Commit 764e3f9

Browse files
author
Devin Walker
committed
* 'master' of https://github.com/WordImpress/Give-ConvertKit: give_get_option to fix notice pass 2 give_get_option to fix notice get_list returns array to fix notice use give_get_option to fix notices Update hook give_purchase_form_before_submit --> give_donation_form_before_submit
2 parents 94a8d10 + 789c61e commit 764e3f9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

includes/class-give-convertkit.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function form_fields( $form_id ) {
196196

197197
//What's the check gonna be? Should the opt-on be checked or unchecked by default...
198198
$form_checked_option = get_post_meta( $form_id, '_give_' . $this->id . '_checked_default', true );
199-
$global_checked_option = $this->give_options[ 'give_' . $this->id . '_checked_default' ];
199+
$global_checked_option = give_get_option( "give_{$this->id}_checked_default" );
200200
$checked_option = 'enabled';
201201

202202
if ( ! empty( $form_checked_option ) && $override_option !== 'default' ) {
@@ -401,7 +401,7 @@ public function render_metabox() {
401401

402402
//Form select
403403
$list_value = get_post_meta( $post->ID, '_give_' . $this->id, true );
404-
$list_value = ! empty( $list_value ) ? $list_value : $this->give_options[ 'give_' . $this->id . '_list' ];
404+
$list_value = ! empty( $list_value ) ? $list_value : give_get_option( "give_{$this->id}_list" );
405405

406406
//Global label
407407
$global_label = isset( $this->give_options[ 'give_' . $this->id . '_label' ] ) ? $this->give_options[ 'give_' . $this->id . '_label' ] : __( 'Signup for the newsletter', 'give-convertkit' );;
@@ -600,7 +600,7 @@ public function save_metabox( $post_id ) {
600600

601601
// Sanitize the user input.
602602
$give_custom_label = isset( $_POST[ '_give_' . $this->id . '_custom_label' ] ) ? sanitize_text_field( $_POST[ '_give_' . $this->id . '_custom_label' ] ) : '';
603-
$give_custom_lists = isset( $_POST[ '_give_' . $this->id ] ) ? $_POST[ '_give_' . $this->id ] : $this->give_options[ 'give_' . $this->id . '_list' ];
603+
$give_custom_lists = isset( $_POST[ '_give_' . $this->id ] ) ? $_POST[ '_give_' . $this->id ] : give_get_option( "give_{$this->id}_list" );
604604
$give_custom_tags = isset( $_POST[ '_give_' . $this->id ] ) ? $_POST[ '_give_' . $this->id . '_tags' ] : $this->give_options[ 'give_' . $this->id . '_tags' ];
605605
$give_override_option = isset( $_POST[ '_give_' . $this->id . '_override_option' ] ) ? esc_html( $_POST[ '_give_' . $this->id . '_override_option' ] ) : '';
606606
$give_subscribe_checked = isset( $_POST[ '_give_' . $this->id . '_checked_default' ] ) ? esc_html( $_POST[ '_give_' . $this->id . '_checked_default' ] ) : '';
@@ -619,7 +619,7 @@ public function save_metabox( $post_id ) {
619619
/**
620620
* Retrieves the lists from ConvertKit
621621
*
622-
* @return mixed
622+
* @return array
623623
*/
624624
public function get_lists() {
625625

@@ -653,7 +653,7 @@ public function get_lists() {
653653

654654
}
655655

656-
return $this->lists;
656+
return (array) $this->lists;
657657

658658
}
659659

@@ -780,7 +780,7 @@ public function settings( $settings ) {
780780
public function show_subscribe_checkbox( $form_id ) {
781781

782782
$override_option = get_post_meta( $form_id, '_give_' . $this->id . '_override_option', true );
783-
$global_option = $this->give_options[ 'give_' . $this->id . '_show_subscribe_checkbox' ];
783+
$global_option = give_get_option( "give_{$this->id}_show_subscribe_checkbox" );
784784

785785
//Is disabled on the form?
786786
if ( $override_option == 'disabled' ) {

0 commit comments

Comments
 (0)