wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
update_post_author_caches › WordPress Function
Seit6.1.0
Veraltetn/v
› update_post_author_caches ( $posts )
| Parameter: |
|
| Definiert in: |
|
| Codex: |
Updates post author user caches for a list of post objects.
Ähnliche Funktionen: update_post_parent_caches, update_post_caches, update_post_cache, update_postmeta_cache, update_post_thumbnail_cache
Quellcode
function update_post_author_caches( $posts ) {
/*
* cache_users() is a pluggable function so is not available prior
* to the `plugins_loaded` hook firing. This is to ensure against
* fatal errors when the function is not available.
*/
if ( ! function_exists( 'cache_users' ) ) {
return;
}
$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 );
}