| @@ -224,8 +224,32 @@ | ||
| 224 | 224 | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 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 | +/** | |
| 228 | 252 | * Helper method to return the Plugin Settings Link |
| 229 | 253 | * |
| 230 | 254 | * @since 1.9.6 |
| 231 | 255 | * |
| @@ -386,8 +410,28 @@ | ||
| 386 | 410 | |
| 387 | 411 | } |
| 388 | 412 | |
| 389 | 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 | +/** | |
| 390 | 434 | * Helper method to return the URL the user needs to visit on the ConvertKit app to create a new Broadcast. |
| 391 | 435 | * |
| 392 | 436 | * @since 2.2.6 |
| 393 | 437 | * |
| @@ -401,8 +445,32 @@ | ||
| 401 | 445 | 'utm_term' => get_locale(), |
| 402 | 446 | 'utm_content' => 'convertkit', |
| 403 | 447 | ), |
| 404 | 448 | 'https://app.convertkit.com/campaigns/' |
| 449 | + ); | |
| 450 | + | |
| 451 | +} | |
| 452 | + | |
| 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 | + ) | |
| 405 | 473 | ); |
| 406 | 474 | |
| 407 | 475 | } |
| 408 | 476 | |