PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.2.3
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.2.3
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 2.3.2 2.3.3 All 194 releases
← All changes | includes/functions.php +0 -94 3.4.03.2.3 View file →
@@ -147,28 +147,8 @@
147 147
148 148 }
149 149
150 150 /**
151 - * Determines whether the current user can create and publish the given Post Type.
152 - *
153 - * @since 3.3.9
154 - *
155 - * @param string $post_type Post Type.
156 - * @return bool User can create and publish Post Type.
157 - */
158 -function convertkit_user_can_create_published_post_type( $post_type ) {
159 -
160 - $post_type_object = get_post_type_object( $post_type );
161 -
162 - if ( ! $post_type_object ) {
163 - return false;
164 - }
165 -
166 - return current_user_can( $post_type_object->cap->create_posts ) && current_user_can( $post_type_object->cap->publish_posts );
167 -
168 -}
169 -
170 -/**
171 151 * Helper method to get supported Post Types for Restricted Content (Member's Content)
172 152 *
173 153 * @since 2.1.0
174 154 *
@@ -254,32 +234,8 @@
254 234
255 235 }
256 236
257 237 /**
258 - * Helper method to get registered plugin sidebars.
259 - *
260 - * @since 3.3.0
261 - *
262 - * @return array Plugin sidebars
263 - */
264 -function convertkit_get_plugin_sidebars() {
265 -
266 - $plugin_sidebars = array();
267 -
268 - /**
269 - * Registers plugin sidebars for the WordPress block editor.
270 - *
271 - * @since 3.3.0
272 - *
273 - * @param array $plugin_sidebars Plugin sidebars.
274 - */
275 - $plugin_sidebars = apply_filters( 'convertkit_plugin_sidebars', $plugin_sidebars );
276 -
277 - return $plugin_sidebars;
278 -
279 -}
280 -
281 -/**
282 238 * Helper method to get registered pre-publish actions.
283 239 *
284 240 * @since 2.4.0
285 241 *
@@ -327,32 +283,8 @@
327 283
328 284 }
329 285
330 286 /**
331 - * Helper method to get registered abilities.
332 - *
333 - * @since 3.4.0
334 - *
335 - * @return array Abilities.
336 - */
337 -function convertkit_get_abilities() {
338 -
339 - $abilities = array();
340 -
341 - /**
342 - * Registers abilities for the Kit Plugin.
343 - *
344 - * @since 3.4.0
345 - *
346 - * @param array $abilities Abilities.
347 - */
348 - $abilities = apply_filters( 'convertkit_abilities', $abilities );
349 -
350 - return $abilities;
351 -
352 -}
353 -
354 -/**
355 287 * Helper method to return the Plugin Settings Link
356 288 *
357 289 * @since 1.9.6
358 290 *
@@ -862,31 +794,8 @@
862 794
863 795 /**
864 796 * Deletes the stored access token, refresh token and its expiry from the Plugin settings,
865 797 * and clears any existing scheduled WordPress Cron event to refresh the token on expiry,
866 - * when the user revokes the access token.
867 - *
868 - * @since 3.2.4
869 - *
870 - * @param string $client_id OAuth Client ID used for the Access and Refresh Tokens.
871 - */
872 -function convertkit_delete_credentials( $client_id ) {
873 -
874 - // Don't delete these credentials if they're not for this Client ID.
875 - // They're for another Kit Plugin that uses OAuth.
876 - if ( $client_id !== CONVERTKIT_OAUTH_CLIENT_ID ) {
877 - return;
878 - }
879 -
880 - // Delete Access and Refresh Tokens.
881 - $settings = new ConvertKit_Settings();
882 - $settings->delete_credentials();
883 -
884 -}
885 -
886 -/**
887 - * Deletes the stored access token, refresh token and its expiry from the Plugin settings,
888 - * and clears any existing scheduled WordPress Cron event to refresh the token on expiry,
889 798 * when either:
890 799 * - The access token is invalid
891 800 * - The access token expired, and refreshing failed
892 801 *
@@ -919,11 +828,8 @@
919 828
920 829 // Update Access Token when refreshed by the API class.
921 830 add_action( 'convertkit_api_get_access_token', 'convertkit_maybe_update_credentials', 10, 2 );
922 831 add_action( 'convertkit_api_refresh_token', 'convertkit_maybe_update_credentials', 10, 2 );
923 -
924 -// Delete credentials when the user revokes the access and refresh tokens.
925 -add_action( 'convertkit_api_revoke_tokens', 'convertkit_delete_credentials', 10, 1 );
926 832
927 833 // Delete credentials if the API class uses a invalid access token.
928 834 // This prevents the Plugin making repetitive API requests that will 401.
929 835 add_action( 'convertkit_api_access_token_invalid', 'convertkit_maybe_delete_credentials', 10, 2 );