← All changes
|
includes/integrations/wishlist/class-convertkit-wishlist-settings.php
+11
-14
2.2.0
→
3.4.4
View file →
| @@ -71,11 +71,8 @@ | ||
| 71 | 71 | |
| 72 | 72 | if ( empty( $this->get() ) ) { |
| 73 | 73 | return false; |
| 74 | 74 | } |
| 75 | - if ( count( $this->get() ) === 0 ) { // @phpstan-ignore-line. | |
| 76 | - return false; | |
| 77 | - } | |
| 78 | 75 | |
| 79 | 76 | return true; |
| 80 | 77 | |
| 81 | 78 | } |
| @@ -80,16 +77,16 @@ | ||
| 80 | 77 | |
| 81 | 78 | } |
| 82 | 79 | |
| 83 | 80 | /** |
| 84 | - * Returns the ConvertKit Form ID that is mapped against the given WishList Member Level ID. | |
| 81 | + * Returns the ConvertKit subscribe setting that is mapped against the given WishList Member Level ID. | |
| 85 | 82 | * |
| 86 | - * @since 1.9.6 | |
| 83 | + * @since 2.5.4 | |
| 87 | 84 | * |
| 88 | 85 | * @param int $wlm_level_id WishList Member Level ID. |
| 89 | - * @return bool|int | |
| 86 | + * @return bool|string false|subscribe|form:id|tag:id|sequence:id. | |
| 90 | 87 | */ |
| 91 | - public function get_convertkit_form_id_by_wishlist_member_level_id( $wlm_level_id ) { | |
| 88 | + public function get_convertkit_add_setting_by_wishlist_member_level_id( $wlm_level_id ) { | |
| 92 | 89 | |
| 93 | 90 | // Bail if no settings exist. |
| 94 | 91 | if ( ! $this->has_settings() ) { |
| 95 | 92 | return false; |
| @@ -95,25 +92,25 @@ | ||
| 95 | 92 | return false; |
| 96 | 93 | } |
| 97 | 94 | |
| 98 | 95 | // Bail if no mapping exists. |
| 99 | - if ( ! array_key_exists( $wlm_level_id . '_form', $this->get() ) ) { | |
| 96 | + if ( ! array_key_exists( $wlm_level_id . '_add', $this->get() ) ) { | |
| 100 | 97 | return false; |
| 101 | 98 | } |
| 102 | 99 | |
| 103 | - return $this->get()[ $wlm_level_id . '_form' ]; | |
| 100 | + return $this->get()[ $wlm_level_id . '_add' ]; | |
| 104 | 101 | |
| 105 | 102 | } |
| 106 | 103 | |
| 107 | 104 | /** |
| 108 | - * Returns the ConvertKit Tag ID that is mapped against the given WishList Member Level ID. | |
| 105 | + * Returns the ConvertKit remove setting that is mapped against the given WishList Member Level ID. | |
| 109 | 106 | * |
| 110 | 107 | * @since 1.9.6 |
| 111 | 108 | * |
| 112 | 109 | * @param int $wlm_level_id WishList Member Level ID. |
| 113 | - * @return bool|string|int false|'unsubscribe'|Tag ID | |
| 110 | + * @return bool|string false|subscribe|unsubscribe|form:id|tag:id|sequence:id. | |
| 114 | 111 | */ |
| 115 | - public function get_convertkit_tag_id_by_wishlist_member_level_id( $wlm_level_id ) { | |
| 112 | + public function get_convertkit_remove_setting_by_wishlist_member_level_id( $wlm_level_id ) { | |
| 116 | 113 | |
| 117 | 114 | // Bail if no settings exist. |
| 118 | 115 | if ( ! $this->has_settings() ) { |
| 119 | 116 | return false; |
| @@ -119,13 +116,13 @@ | ||
| 119 | 116 | return false; |
| 120 | 117 | } |
| 121 | 118 | |
| 122 | 119 | // Bail if no mapping exists. |
| 123 | - if ( ! array_key_exists( $wlm_level_id . '_unsubscribe', $this->get() ) ) { | |
| 120 | + if ( ! array_key_exists( $wlm_level_id . '_remove', $this->get() ) ) { | |
| 124 | 121 | return false; |
| 125 | 122 | } |
| 126 | 123 | |
| 127 | - return $this->get()[ $wlm_level_id . '_unsubscribe' ]; | |
| 124 | + return $this->get()[ $wlm_level_id . '_remove' ]; | |
| 128 | 125 | |
| 129 | 126 | } |
| 130 | 127 | |
| 131 | 128 | /** |