Fix announcement form flyer upload never showing (#252)#253
Merged
Conversation
wp_localize_script converts PHP boolean true to string "1", but the JS check only matched boolean true or string "true". Pass the raw string attribute value instead so the existing JS check works correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
show_flyer="true"was set on the shortcode.wp_localize_scriptconverts PHPboolean trueto string"1", but the JS check only matchedboolean trueor string"true". The fix passes the raw shortcode attribute string value ("true") instead of comparing it to a boolean in PHP.Test plan
[mayo_announcement_form show_flyer="true"]shortcode to a page[mayo_announcement_form show_flyer="false"]shortcode to a page[mayo_announcement_form]shortcode withoutshow_flyerattribute🤖 Generated with Claude Code