Skip to content

Fix announcement form flyer upload never showing (#252)#253

Merged
dgershman merged 1 commit intomainfrom
fix/announcement-flyer-upload-252
Mar 16, 2026
Merged

Fix announcement form flyer upload never showing (#252)#253
dgershman merged 1 commit intomainfrom
fix/announcement-flyer-upload-252

Conversation

@dgershman
Copy link
Contributor

Summary

  • Fixed the announcement form flyer upload field never appearing even when show_flyer="true" was set on the shortcode.
  • Root cause: wp_localize_script converts PHP boolean true to string "1", but the JS check only matched boolean true or string "true". The fix passes the raw shortcode attribute string value ("true") instead of comparing it to a boolean in PHP.
  • Bumped version to 1.8.7.

Test plan

  • Add [mayo_announcement_form show_flyer="true"] shortcode to a page
  • Verify the flyer upload field is visible on the announcement form
  • Add [mayo_announcement_form show_flyer="false"] shortcode to a page
  • Verify the flyer upload field is hidden
  • Add [mayo_announcement_form] shortcode without show_flyer attribute
  • Verify the flyer upload field is hidden (default behavior)
  • Submit an announcement with a flyer attached and confirm it saves correctly

🤖 Generated with Claude Code

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>
@dgershman dgershman merged commit 282e9ad into main Mar 16, 2026
3 checks passed
@dgershman dgershman deleted the fix/announcement-flyer-upload-252 branch March 16, 2026 18:23
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.

1 participant