PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 2.3.7
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v2.3.7
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 +79 -11 2.2.72.3.7 View file →
@@ -135,8 +135,9 @@
135 135 function convertkit_get_supported_restrict_content_post_types() {
136 136
137 137 $post_types = array(
138 138 'page',
139 + 'post',
139 140 );
140 141
141 142 /**
142 143 * Defines the Post Types that support Restricted Content / Members Content functionality.
@@ -223,8 +224,32 @@
223 224
224 225 }
225 226
226 227 /**
228 + * Helper method to get registered pre-publish actions.
229 + *
230 + * @since 2.4.0
231 + *
232 + * @return array Pre-publish actions
233 + */
234 +function convertkit_get_pre_publish_actions() {
235 +
236 + $pre_publish_actions = array();
237 +
238 + /**
239 + * Registers pre-publish actions for the ConvertKit Plugin.
240 + *
241 + * @since 2.4.0
242 + *
243 + * @param array $pre_publish_panels Pre-publish actions.
244 + */
245 + $pre_publish_actions = apply_filters( 'convertkit_get_pre_publish_actions', $pre_publish_actions );
246 +
247 + return $pre_publish_actions;
248 +
249 +}
250 +
251 +/**
227 252 * Helper method to return the Plugin Settings Link
228 253 *
229 254 * @since 1.9.6
230 255 *
@@ -260,9 +285,9 @@
260 285 'page' => 'convertkit-setup',
261 286 )
262 287 );
263 288
264 - return add_query_arg( $query_args, admin_url( 'index.php' ) );
289 + return add_query_arg( $query_args, admin_url( 'options.php' ) );
265 290
266 291 }
267 292
268 293 /**
@@ -385,8 +410,28 @@
385 410
386 411 }
387 412
388 413 /**
414 + * Helper method to return the URL the user needs to visit on the ConvertKit app to create a new Tag.
415 + *
416 + * @since 2.3.3
417 + *
418 + * @return string ConvertKit App URL.
419 + */
420 +function convertkit_get_new_tag_url() {
421 +
422 + return add_query_arg(
423 + array(
424 + 'utm_source' => 'wordpress',
425 + 'utm_term' => get_locale(),
426 + 'utm_content' => 'convertkit',
427 + ),
428 + 'https://app.convertkit.com/subscribers/'
429 + );
430 +
431 +}
432 +
433 +/**
389 434 * Helper method to return the URL the user needs to visit on the ConvertKit app to create a new Broadcast.
390 435 *
391 436 * @since 2.2.6
392 437 *
@@ -405,8 +450,32 @@
405 450
406 451 }
407 452
408 453 /**
454 + * Helper method to return the URL the user needs to visit on the ConvertKit app to edit a draft Broadcast.
455 + *
456 + * @since 2.4.0
457 + *
458 + * @param int $broadcast_id ConvertKit Broadcast ID.
459 + * @return string ConvertKit App URL.
460 + */
461 +function convertkit_get_edit_broadcast_url( $broadcast_id ) {
462 +
463 + return add_query_arg(
464 + array(
465 + 'utm_source' => 'wordpress',
466 + 'utm_term' => get_locale(),
467 + 'utm_content' => 'convertkit',
468 + ),
469 + sprintf(
470 + 'https://app.convertkit.com/campaigns/%s/draft',
471 + $broadcast_id
472 + )
473 + );
474 +
475 +}
476 +
477 +/**
409 478 * Helper method to return the URL the user needs to visit on the ConvertKit app to create a new Product.
410 479 *
411 480 * @since 2.2.3
412 481 *
@@ -458,22 +527,21 @@
458 527 * @return string File contents.
459 528 */
460 529 function convertkit_get_file_contents( $local_file ) {
461 530
462 - // Call globals.
463 - global $wp_filesystem;
531 + // Bail if the file doesn't exist.
532 + if ( ! file_exists( $local_file ) ) {
533 + return '';
534 + }
464 535
465 - // Load filesystem class.
466 - require_once ABSPATH . 'wp-admin/includes/file.php';
536 + // Read file.
537 + $contents = file_get_contents( $local_file ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
467 538
468 - // Initiate.
469 - WP_Filesystem();
470 -
471 - // Bail if the file doesn't exist.
472 - if ( ! $wp_filesystem->exists( $local_file ) ) {
539 + // Return an empty string if the contents of the file could not be read.
540 + if ( ! $contents ) {
473 541 return '';
474 542 }
475 543
476 544 // Return file's contents.
477 - return $wp_filesystem->get_contents( $local_file );
545 + return $contents;
478 546
479 547 }