File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,23 @@ public function test_ping_on_post_trash() {
170170 $ this ->assertNotPing ( home_url ( "/?p= {$ post_id }" ), 'Ping should not include the trashed post URL. ' );
171171 }
172172
173+ /**
174+ * Ensure unpublishing a post pings the old URL.
175+ */
176+ public function test_ping_on_unpublishing () {
177+ $ post_id = self ::$ post_ids ['publish ' ];
178+
179+ wp_update_post (
180+ array (
181+ 'ID ' => $ post_id ,
182+ 'post_status ' => 'draft ' ,
183+ )
184+ );
185+
186+ $ this ->assertPing ( home_url ( '/2025/test-post-publish/ ' ), 'Ping should include the post URL on unpublishing. ' );
187+ $ this ->assertNotPing ( home_url ( "/?p= {$ post_id }" ), 'Ping should not include the unpublished post URL. ' );
188+ }
189+
173190 /**
174191 * Ensure publishing a draft post pings the URL.
175192 */
You can’t perform that action at this time.
0 commit comments