进行了一些小修复
This commit is contained in:
1 parent
992af2119d
commit
2cb78edabb
26 files changed
+2091
-2383
No files matched your search
@@ -265,7 +265,7 @@ if (!function_exists('aksrt_resource_preview_images')) {
|
||||
/**
|
||||
* Collect preview images for resource cards and archive thumbnails.
|
||||
*
|
||||
* Priority: curated cover_images meta -> featured image -> gallery/content images.
|
||||
* Priority: curated featured-slide images -> featured image -> gallery/content images.
|
||||
*
|
||||
* @param int|WP_Post|null $post
|
||||
* @param int $limit
|
||||
@@ -281,9 +281,9 @@ if (!function_exists('aksrt_resource_preview_images')) {
|
||||
$images = [];
|
||||
|
||||
if (class_exists('\AKSRT\Core\PostMetaBox')) {
|
||||
$cover_images = (string) \AKSRT\Core\PostMetaBox::get_meta_value($p->ID, 'cover_images', '');
|
||||
if ($cover_images !== '') {
|
||||
$cover_ids = array_filter(array_map('absint', preg_split('/[\s,]+/', $cover_images) ?: []));
|
||||
$featured_slide = (string) \AKSRT\Core\PostMetaBox::get_meta_value($p->ID, 'featured_slide', '');
|
||||
if ($featured_slide !== '') {
|
||||
$cover_ids = array_filter(array_map('absint', preg_split('/[\s,]+/', $featured_slide) ?: []));
|
||||
foreach ($cover_ids as $attachment_id) {
|
||||
$url = (string) wp_get_attachment_image_url($attachment_id, 'medium_large');
|
||||
if ($url !== '') {
|
||||
|
||||
Reference in new issue
Block a user