How to access post meta on the first time a post is published
I usually handle this with save_post action. // We’ll use 1000, low priority (we’ll let other hooks to run first) add_action( ‘save_post’, [$this, ‘jackie_publish_post_hook’], 1000, 3 ); Then within your class: function jackie_publish_post_hook( $post_id, $post, $update ) { if ( $update ) return false; // Post already existed, don’t proceed // Do stuff } Or … Read more