[wp-trac] [WordPress Trac] #60922: get_custom_logo returns an empty link when no logo image is set
WordPress Trac
noreply at wordpress.org
Wed Apr 10 14:44:35 UTC 2024
#60922: get_custom_logo returns an empty link when no logo image is set
--------------------------+----------------------------
Reporter: afercia | Owner: joedolson
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 6.6
Component: Themes | Version:
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: accessibility
--------------------------+----------------------------
Comment (by afercia):
> the scenarios where this will be triggered are relatively uncommon,
Yes I'd agree they are uncommon but, still, WordPress shouldn't output
empty links, ever. The output fix is simple enough to be addressed.
> There are two aspects to address: 1) unsetting the theme mod when the
site logo is deleted and 2) correctly handling the case where
wp_get_attachment_image returns an empty string.
Not sure the first aspect can be solved easily. I'm not sure we should try
to fix it by deleting the theme mod option. Technically, the option _is_
set because users did so in the admin interface. It's just the image that
may be missing.
How about to consider to check whether the image actually exists and
outputs a notice in the admin? Ideally, also in the editor.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60922#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list