get_post_galleries_images

函数
get_post_galleries_images ( $post = 0 )
参数
  • (int|WP_Post) $post Optional. Post ID or WP_Post object. Default is global `$post`.
    Required:
返回值
  • (array) A list of lists, each containing image srcs parsed. from an expanded shortcode
相关
  • get_post_galleries()
定义位置
相关方法
get_post_gallery_imagesget_post_galleriesget_post_galleryget_post_datetimewp_get_post_categories
引入
3.6.0
弃用
-

get_post_galleries_images函数返回文章中所有图库中所有图像的数组。它接受一个参数,即文章的ID。

如果有的话,从文章的内容中检索画廊的图片来源。

function get_post_galleries_images( $post = 0 ) {
	$galleries = get_post_galleries( $post, false );
	return wp_list_pluck( $galleries, 'src' );
}

常见问题

FAQs
查看更多 >