wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



_update_posts_count_on_delete › WordPress Function

Od4.0.0
Przestarzałyn/a
_update_posts_count_on_delete ( $post_id, $post )
Parametry: (2)
  • (int) $post_id Post ID.
    Wymagane: Tak
  • (WP_Post) $post Post object.
    Wymagane: Tak
Zdefiniowane na:
Codex:
Dziennik zmian:
  • 6.2.0

Handler for updating the current site's posts count when a post is deleted.



Źródło

function _update_posts_count_on_delete( $post_id, $post ) {
	if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {
		return;
	}

	update_posts_count();
}