wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



update_post_parent_caches › WordPress Function

Depuis6.1.0
Dépréciéen/a
update_post_parent_caches ( $posts )
Paramètres:
  • (WP_Post[]) $posts Array of post objects.
    Requis: Oui
Défini(e) dans:
Codex:

Updates parent post caches for a list of post objects.



Source

function update_post_parent_caches( $posts ) {
	$parent_ids = wp_list_pluck( $posts, 'post_parent' );
	$parent_ids = array_map( 'absint', $parent_ids );
	$parent_ids = array_unique( array_filter( $parent_ids ) );

	if ( ! empty( $parent_ids ) ) {
		_prime_post_caches( $parent_ids, false );
	}
}