PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 2.4.1
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v2.4.1
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 +33 -1 2.2.62.4.1 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 }
@@ -72,8 +73,39 @@
72 73
73 74 }
74 75
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';
104 +
105 + }
106 +
107 + /**
76 108 * Adds a meta box for the given Post Type.
77 109 *
78 110 * @since 1.9.6
79 111 *
@@ -204,9 +236,9 @@
204 236 $new_value = sanitize_text_field( wp_unslash( $settings[ $key ] ) );
205 237
206 238 // Skip if the setting value is -2, as this means it's a Bulk Edit request and this setting
207 239 // is set as 'No Change'.
208 - if ( $new_value == '-2' ) { // phpcs:ignore WordPress.PHP.StrictComparisons
240 + if ( $new_value == '-2' ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual
209 241 continue;
210 242 }
211 243
212 244 // Update setting using posted value.