wpseek.com
A WordPress-centric search engine for devs and theme authors



update_post_author_caches › WordPress Function

Since6.1.0
Deprecatedn/a
update_post_author_caches ( $posts )
Parameters:
  • (WP_Post[]) $posts Array of post objects.
    Required: Yes
Defined at:
Codex:

Updates post author user caches for a list of post objects.



Source

function update_post_author_caches( $posts ) {
	$author_ids = wp_list_pluck( $posts, 'post_author' );
	$author_ids = array_map( 'absint', $author_ids );
	$author_ids = array_unique( array_filter( $author_ids ) );

	cache_users( $author_ids );
}