PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 2.5.1
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v2.5.1
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 +87 -29 2.3.22.5.1 View file →
@@ -106,13 +106,35 @@
106 106 * @return array Post Types
107 107 */
108 108 function convertkit_get_supported_post_types() {
109 109
110 + // Define supported Post Types.
110 111 $post_types = array(
111 112 'page',
112 113 'post',
113 114 );
114 115
116 + // If public Custom Post Types can be fetched, include them now.
117 + if ( function_exists( 'get_post_types' ) ) {
118 + // Get public Custom Post Types.
119 + $custom_post_types = get_post_types(
120 + array(
121 + 'public' => true,
122 +
123 + // Don't include WordPress' built in Post Types, such as attachment, revisino and nav_menu_item.
124 + '_builtin' => false,
125 + )
126 + );
127 +
128 + // Sanity check an array was returned.
129 + if ( is_array( $custom_post_types ) ) {
130 + $post_types = array_merge(
131 + $post_types,
132 + array_keys( $custom_post_types )
133 + );
134 + }
135 + }
136 +
115 137 /**
116 138 * Defines the Post Types that support ConvertKit Forms.
117 139 *
118 140 * @since 1.9.6
@@ -129,28 +151,16 @@
129 151 * Helper method to get supported Post Types for Restricted Content (Member's Content)
130 152 *
131 153 * @since 2.1.0
132 154 *
155 + * @deprecated 2.4.3 No longer used by internal code and not recommended. Use `convertkit_get_supported_post_types` instead.
156 + *
133 157 * @return array Post Types
134 158 */
135 159 function convertkit_get_supported_restrict_content_post_types() {
136 160
137 - $post_types = array(
138 - 'page',
139 - 'post',
140 - );
161 + return convertkit_get_supported_post_types();
141 162
142 - /**
143 - * Defines the Post Types that support Restricted Content / Members Content functionality.
144 - *
145 - * @since 2.0.0
146 - *
147 - * @param array $post_types Post Types
148 - */
149 - $post_types = apply_filters( 'convertkit_get_supported_restrict_content_post_types', $post_types );
150 -
151 - return $post_types;
152 -
153 163 }
154 164
155 165 /**
156 166 * Helper method to get registered Shortcodes.
@@ -224,8 +234,32 @@
224 234
225 235 }
226 236
227 237 /**
238 + * Helper method to get registered pre-publish actions.
239 + *
240 + * @since 2.4.0
241 + *
242 + * @return array Pre-publish actions
243 + */
244 +function convertkit_get_pre_publish_actions() {
245 +
246 + $pre_publish_actions = array();
247 +
248 + /**
249 + * Registers pre-publish actions for the ConvertKit Plugin.
250 + *
251 + * @since 2.4.0
252 + *
253 + * @param array $pre_publish_panels Pre-publish actions.
254 + */
255 + $pre_publish_actions = apply_filters( 'convertkit_get_pre_publish_actions', $pre_publish_actions );
256 +
257 + return $pre_publish_actions;
258 +
259 +}
260 +
261 +/**
228 262 * Helper method to return the Plugin Settings Link
229 263 *
230 264 * @since 1.9.6
231 265 *
@@ -326,15 +360,15 @@
326 360
327 361 }
328 362
329 363 /**
330 - * Helper method to return the URL the user needs to visit on the ConvertKit app to obtain their API Key and Secret.
364 + * Helper method to return the URL the user needs to visit on the ConvertKit app to create a new Form or Landing Page.
331 365 *
332 - * @since 1.9.6.1
366 + * @since 2.2.3
333 367 *
334 - * @return string ConvertKit App URL.
368 + * @return string ConvertKit App URL
335 369 */
336 -function convertkit_get_api_key_url() {
370 +function convertkit_get_new_form_url() {
337 371
338 372 return add_query_arg(
339 373 array(
340 374 'utm_source' => 'wordpress',
@@ -340,21 +374,21 @@
340 374 'utm_source' => 'wordpress',
341 375 'utm_term' => get_locale(),
342 376 'utm_content' => 'convertkit',
343 377 ),
344 - 'https://app.convertkit.com/account_settings/advanced_settings/'
378 + 'https://app.convertkit.com/forms/new/'
345 379 );
346 380
347 381 }
348 382
349 383 /**
350 - * Helper method to return the URL the user needs to visit on the ConvertKit app to create a new Form or Landing Page.
384 + * Helper method to return the URL the user needs to visit to edit ConvertKit forms.
351 385 *
352 386 * @since 2.2.3
353 387 *
354 - * @return string ConvertKit App URL
388 + * @return string ConvertKit Form Editor URL.
355 389 */
356 -function convertkit_get_new_form_url() {
390 +function convertkit_get_form_editor_url() {
357 391
358 392 return add_query_arg(
359 393 array(
360 394 'utm_source' => 'wordpress',
@@ -360,21 +394,21 @@
360 394 'utm_source' => 'wordpress',
361 395 'utm_term' => get_locale(),
362 396 'utm_content' => 'convertkit',
363 397 ),
364 - 'https://app.convertkit.com/forms/new/'
398 + 'https://app.convertkit.com/forms'
365 399 );
366 400
367 401 }
368 402
369 403 /**
370 - * Helper method to return the URL the user needs to visit to edit ConvertKit forms.
404 + * Helper method to return the URL the user needs to visit on the ConvertKit app to create a new Tag.
371 405 *
372 - * @since 2.2.3
406 + * @since 2.3.3
373 407 *
374 - * @return string ConvertKit Form Editor URL.
408 + * @return string ConvertKit App URL.
375 409 */
376 -function convertkit_get_form_editor_url() {
410 +function convertkit_get_new_tag_url() {
377 411
378 412 return add_query_arg(
379 413 array(
380 414 'utm_source' => 'wordpress',
@@ -380,9 +414,9 @@
380 414 'utm_source' => 'wordpress',
381 415 'utm_term' => get_locale(),
382 416 'utm_content' => 'convertkit',
383 417 ),
384 - 'https://app.convertkit.com/forms'
418 + 'https://app.convertkit.com/subscribers/'
385 419 );
386 420
387 421 }
388 422
@@ -401,8 +435,32 @@
401 435 'utm_term' => get_locale(),
402 436 'utm_content' => 'convertkit',
403 437 ),
404 438 'https://app.convertkit.com/campaigns/'
439 + );
440 +
441 +}
442 +
443 +/**
444 + * Helper method to return the URL the user needs to visit on the ConvertKit app to edit a draft Broadcast.
445 + *
446 + * @since 2.4.0
447 + *
448 + * @param int $broadcast_id ConvertKit Broadcast ID.
449 + * @return string ConvertKit App URL.
450 + */
451 +function convertkit_get_edit_broadcast_url( $broadcast_id ) {
452 +
453 + return add_query_arg(
454 + array(
455 + 'utm_source' => 'wordpress',
456 + 'utm_term' => get_locale(),
457 + 'utm_content' => 'convertkit',
458 + ),
459 + sprintf(
460 + 'https://app.convertkit.com/campaigns/%s/draft',
461 + $broadcast_id
462 + )
405 463 );
406 464
407 465 }
408 466