← All changes
|
includes/pre-publish-actions/class-convertkit-pre-publish-action.php
+5
-0
3.3.6
→
3.4.6
View file →
| @@ -210,8 +210,13 @@ | ||
| 210 | 210 | if ( ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['wp-convertkit-pre-publish-actions-nonce'] ) ), 'wp-convertkit-pre-publish-actions' ) ) { |
| 211 | 211 | return; |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | + // Bail if the current user cannot edit this Post. | |
| 215 | + if ( ! current_user_can( 'edit_post', $post_id ) ) { | |
| 216 | + return; | |
| 217 | + } | |
| 218 | + | |
| 214 | 219 | // Delete meta key if this action's checkbox has not been checked. |
| 215 | 220 | if ( ! array_key_exists( $this->meta_key, $_POST ) ) { |
| 216 | 221 | return delete_post_meta( $post_id, $this->meta_key ); |
| 217 | 222 | } |