From 6d12991afe33eb6577216b4c819a7278707d3065 Mon Sep 17 00:00:00 2001 From: Aaron Ware Date: Tue, 21 Feb 2023 20:18:26 -0500 Subject: [PATCH] fix(#312): Fix an issue with post meta being saving in all post types --- src/Controller/Courier.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Controller/Courier.php b/src/Controller/Courier.php index 9992bd0..58edefc 100755 --- a/src/Controller/Courier.php +++ b/src/Controller/Courier.php @@ -396,11 +396,16 @@ public function save_post_courier_notice( $post_id, $post ) { * * @since 1.0 * - * @param int $post_id The post ID. - * @param array|object $post The post object. - * @param bool $update Whether or not to update. + * @param int $post_id The post ID. + * @param array|\WP_Post $post The post object. + * @param bool $update Insert or Update flag. */ - public function wp_insert_post( $post_id, $post, $update ) { + public function wp_insert_post( int $post_id, $post, bool $update ) { + + if ( 'courier_notice' !== $post->post_type ) { + return; + } + if ( ! is_admin() ) { return; }