Skip to content

Conversation

@n7studios
Copy link
Contributor

Summary

This PR fixes an issue where the data-kit-limit-per-session attribute was always being set to true when rendering the non-inline global form. It should correctly reflect the configured setting (true or false).

As a result, the ck_non_inline_form_displayed cookie was also always being set, since setting data-kit-limit-per-session to boolean true or false caused the related JavaScript to trigger unconditionally. This has been resolved by outputting data-kit-limit-per-session as 1 or 0, updating the JS selector accordingly.

This did not break overall functionality (since is_script_output_limited_by_session was always run to check whether all or one form should be output). However, this update ensures the logic and behavior are consistent and cleanly implemented.

Testing

testNonInlineFormLimitPerSessionDoesNotSetCookieWhenDisabled: Test that the ck_non_inline_form_displayed cookie is not set when the non inline form limit per session setting is disabled.

Checklist

@n7studios n7studios self-assigned this Nov 7, 2025
@github-actions
Copy link

github-actions bot commented Nov 9, 2025

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios n7studios requested review from a team, corydhmiller and noelherrick and removed request for a team November 10, 2025 01:08
@n7studios n7studios marked this pull request as ready for review November 11, 2025 06:56
@n7studios n7studios merged commit f8a7c91 into main Nov 11, 2025
264 of 284 checks passed
@n7studios n7studios deleted the fix-limit-modal-forms-per-session branch November 11, 2025 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants