PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 2.4.0
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v2.4.0
3.4.3 3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 All 196 releases
← All changes | admin/class-convertkit-admin-category.php +10 -16 3.3.92.4.0 View file →
@@ -84,11 +84,8 @@
84 84
85 85 // Enqueue Category CSS.
86 86 wp_enqueue_style( 'convertkit-category', CONVERTKIT_PLUGIN_URL . 'resources/backend/css/category.css', array(), CONVERTKIT_PLUGIN_VERSION );
87 87
88 - // Enqueue Refresh Resources CSS.
89 - wp_enqueue_style( 'convertkit-admin-refresh-resources', CONVERTKIT_PLUGIN_URL . 'resources/backend/css/refresh-resources.css', array(), CONVERTKIT_PLUGIN_VERSION );
90 -
91 88 /**
92 89 * Enqueue CSS when editing a Category that outputs
93 90 * ConvertKit Plugin settings.
94 91 *
@@ -113,15 +110,20 @@
113 110 return false;
114 111 }
115 112
116 113 // Bail if we are not editing a Category.
117 - if ( convertkit_get_current_screen( 'id' ) !== 'edit-category' ) {
114 + if ( ! function_exists( 'get_current_screen' ) ) {
118 115 return false;
119 116 }
117 + $screen = get_current_screen();
120 118
119 + if ( $screen->id !== 'edit-category' ) {
120 + return false;
121 + }
122 +
121 123 // Bail if the API hasn't been configured.
122 124 $settings = new ConvertKit_Settings();
123 - if ( ! $settings->has_access_and_refresh_token() ) {
125 + if ( ! $settings->has_api_key_and_secret() ) {
124 126 return false;
125 127 }
126 128
127 129 return true;
@@ -135,9 +137,9 @@
135 137 public function add_category_form_fields() {
136 138
137 139 // Don't show the form fields if the API hasn't been configured.
138 140 $settings = new ConvertKit_Settings();
139 - if ( ! $settings->has_access_and_refresh_token() ) {
141 + if ( ! $settings->has_api_key_and_secret() ) {
140 142 return;
141 143 }
142 144
143 145 // Fetch Forms.
@@ -158,9 +160,9 @@
158 160 public function edit_category_form_fields( $term ) {
159 161
160 162 // Don't show the form fields if the API hasn't been configured.
161 163 $settings = new ConvertKit_Settings();
162 - if ( ! $settings->has_access_and_refresh_token() ) {
164 + if ( ! $settings->has_api_key_and_secret() ) {
163 165 return;
164 166 }
165 167
166 168 // Fetch Category Settings and Forms.
@@ -180,13 +182,8 @@
180 182 * @param int $term_id Term ID.
181 183 */
182 184 public function save_category_fields( $term_id ) {
183 185
184 - // Bail if the current user cannot edit this Category.
185 - if ( ! current_user_can( 'edit_term', $term_id ) ) {
186 - return;
187 - }
188 -
189 186 // Bail if no nonce field exists.
190 187 if ( ! isset( $_POST['wp-convertkit-save-meta-nonce'] ) ) {
191 188 return;
192 189 }
@@ -201,12 +198,9 @@
201 198 return;
202 199 }
203 200
204 201 // Build metadata.
205 - $meta = array(
206 - 'form' => ( isset( $_POST['wp-convertkit']['form'] ) ? intval( $_POST['wp-convertkit']['form'] ) : '' ),
207 - 'form_position' => ( isset( $_POST['wp-convertkit']['form_position'] ) ? sanitize_text_field( wp_unslash( $_POST['wp-convertkit']['form_position'] ) ) : '' ),
208 - );
202 + $meta = ( isset( $_POST['wp-convertkit']['form'] ) ? intval( $_POST['wp-convertkit']['form'] ) : '' );
209 203
210 204 // Save metadata.
211 205 $convertkit_term = new ConvertKit_Term( $term_id );
212 206 return $convertkit_term->save( $meta );