| @@ -121,9 +121,9 @@ | ||
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | // Bail if the API hasn't been configured. |
| 124 | 124 | $settings = new ConvertKit_Settings(); |
| 125 | - if ( ! $settings->has_api_key_and_secret() ) { | |
| 125 | + if ( ! $settings->has_access_and_refresh_token() ) { | |
| 126 | 126 | return false; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | return true; |
| @@ -137,9 +137,9 @@ | ||
| 137 | 137 | public function add_category_form_fields() { |
| 138 | 138 | |
| 139 | 139 | // Don't show the form fields if the API hasn't been configured. |
| 140 | 140 | $settings = new ConvertKit_Settings(); |
| 141 | - if ( ! $settings->has_api_key_and_secret() ) { | |
| 141 | + if ( ! $settings->has_access_and_refresh_token() ) { | |
| 142 | 142 | return; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | // Fetch Forms. |
| @@ -160,9 +160,9 @@ | ||
| 160 | 160 | public function edit_category_form_fields( $term ) { |
| 161 | 161 | |
| 162 | 162 | // Don't show the form fields if the API hasn't been configured. |
| 163 | 163 | $settings = new ConvertKit_Settings(); |
| 164 | - if ( ! $settings->has_api_key_and_secret() ) { | |
| 164 | + if ( ! $settings->has_access_and_refresh_token() ) { | |
| 165 | 165 | return; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | // Fetch Category Settings and Forms. |
| @@ -198,9 +198,12 @@ | ||
| 198 | 198 | return; |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | // Build metadata. |
| 202 | - $meta = ( isset( $_POST['wp-convertkit']['form'] ) ? intval( $_POST['wp-convertkit']['form'] ) : '' ); | |
| 202 | + $meta = array( | |
| 203 | + 'form' => ( isset( $_POST['wp-convertkit']['form'] ) ? intval( $_POST['wp-convertkit']['form'] ) : '' ), | |
| 204 | + 'form_position' => ( isset( $_POST['wp-convertkit']['form_position'] ) ? $_POST['wp-convertkit']['form_position'] : '' ), | |
| 205 | + ); | |
| 203 | 206 | |
| 204 | 207 | // Save metadata. |
| 205 | 208 | $convertkit_term = new ConvertKit_Term( $term_id ); |
| 206 | 209 | return $convertkit_term->save( $meta ); |