if ( isset( $posts ) && isset( $posts[0]->{$id_field} ) ) {
                // Post does exist after checking the matching value. We want its id.
                $post_id = $posts[0]->{$id_field};

                if ( true === $check_only ) {