WPSEO_Sitemap_Image_Parser::get_attachments
Returns the attachments.
Метод класса: WPSEO_Sitemap_Image_Parser{}
Хуков нет.
Возвращает
Массив. The found attachments.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_attachments( $args );
- $args(массив) (обязательный)
- Array with query args.
Код WPSEO_Sitemap_Image_Parser::get_attachments() WPSEO Sitemap Image Parser::get attachments Yoast 27.3
protected function get_attachments( $args ) {
$default_args = [
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
// Defaults taken from function get_posts.
'orderby' => 'date',
'order' => 'DESC',
'meta_key' => '',
'meta_value' => '',
'suppress_filters' => true,
'ignore_sticky_posts' => true,
'no_found_rows' => true,
];
$args = wp_parse_args( $args, $default_args );
$get_attachments = new WP_Query();
return $get_attachments->query( $args );
}