| @@ -110,8 +110,15 @@ | ||
| 110 | 110 | $post_ids = array_map( 'intval', (array) $_REQUEST['post'] ); |
| 111 | 111 | |
| 112 | 112 | // Iterate through each Post, updating its settings. |
| 113 | 113 | foreach ( $post_ids as $post_id ) { |
| 114 | + // Skip Posts the current user cannot edit. | |
| 115 | + // The post type's edit_posts capability checked above does not grant | |
| 116 | + // permission to edit every Post of that type. | |
| 117 | + if ( ! current_user_can( 'edit_post', $post_id ) ) { | |
| 118 | + continue; | |
| 119 | + } | |
| 120 | + | |
| 114 | 121 | WP_ConvertKit()->get_class( 'admin_post' )->save_post_settings( $post_id, wp_unslash( $_REQUEST['wp-convertkit'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 115 | 122 | } |
| 116 | 123 | |
| 117 | 124 | } |