Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with get attachment image src #447

Merged

Conversation

stuartshields
Copy link
Contributor

So while wp_get_attachment_image_src accepts int for post_id in some cases when doing something like the following:

wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full', false );

This will fatal. This happens because get_post_thumbnail_id can return int|false.

Let's not be so strict.

Copy link

@hm-linter hm-linter bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting failed (1014 errors).

(1012 notices occurred in your codebase, but were on files/lines not included in this PR.)

@stuartshields stuartshields merged commit 511d2d3 into private-attachments Sep 25, 2020
@stuartshields stuartshields deleted the fix-issue-with-get-attachment-image-src branch September 25, 2020 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants