PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 2.4.0
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v2.4.0
3.4.4 3.4.3 3.4.2 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 All 197 releases
← All changes | admin/class-convertkit-admin-post.php +32 -0 2.2.92.4.0 View file →
@@ -22,8 +22,9 @@
22 22 * @since 1.9.6
23 23 */
24 24 public function __construct() {
25 25
26 + add_action( 'post_submitbox_misc_actions', array( $this, 'output_pre_publish_actions' ) );
26 27 add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
27 28 add_action( 'save_post', array( $this, 'save_post_meta' ) );
28 29
29 30 }
@@ -68,8 +69,39 @@
68 69 *
69 70 * @since 1.9.6.4
70 71 */
71 72 do_action( 'convertkit_admin_post_enqueue_styles' );
73 +
74 + }
75 +
76 + /**
77 + * Registers actions in the pre-publish actions section of the Publish metabox
78 + * in the Classic Editor.
79 + *
80 + * @since 2.4.0
81 + *
82 + * @param WP_Post $post WordPress Post.
83 + */
84 + public function output_pre_publish_actions( $post ) {
85 +
86 + // Bail if no actions registered.
87 + $pre_publish_actions = convertkit_get_pre_publish_actions();
88 + if ( ! count( $pre_publish_actions ) ) {
89 + return;
90 + }
91 +
92 + // Bail if Post is not a supported Post Type.
93 + if ( get_post_type( $post ) !== 'post' ) {
94 + return;
95 + }
96 +
97 + // Bail if Post is not a draft.
98 + if ( ! in_array( $post->post_status, array( 'draft', 'auto-draft' ), true ) ) {
99 + return;
100 + }
101 +
102 + // Load pre-publish actions view.
103 + include CONVERTKIT_PLUGIN_PATH . '/views/backend/post/pre-publish-actions.php';
72 104
73 105 }
74 106
75 107 /**