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 notices from an undefined post variable #104

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

srtfisher
Copy link

Fixes notices from the shortcode when used on taxonomy pages (which do not have a $post set):

PHP message: Warning: Attempt to read property "ID" on null in /var/www/wp-content/plugins/polldaddy/polldaddy-shortcode.php on line 127

Changes proposed in this Pull Request:

Testing instructions:

Screenshot / Video

Proposed changelog entry for your changes:

@jgcaruso
Copy link
Contributor

Hey there, thanks for the contribution and sorry for the delay in a response.

While the code change itself looks reasonable (and safer), would you mind providing testing instructions? I'm having trouble reproducing the original issue on the main branch. Pages set with a custom taxonomy seem to be working fine for me. Are you doing something differently? Is it on the taxonomy preview page and the full page content is being displayed instead of a summary?

My main concern here is I'd like to provide defaults for the values that are not having any values set (ex $unique_id)

Also, I don't think we want to introduce a composer.json, so would you mind excluding it from the PR? Thanks!

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.

2 participants