| @@ -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 | * |
| @@ -400,8 +445,32 @@ | ||
| 400 | 445 | 'utm_term' => get_locale(), |
| 401 | 446 | 'utm_content' => 'convertkit', |
| 402 | 447 | ), |
| 403 | 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 | + ) | |
| 404 | 473 | ); |
| 405 | 474 | |
| 406 | 475 | } |
| 407 | 476 | |