Prevent failed attempts to override the reply-title heading in comment form #4388
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
This is a short-term fix to prevent attempting to integrate amp-bind with the “Leave a Reply” heading in the comment form. Because WordPress only provides a
comment_form_defaults
filter for thecomment_form()
function, and not a filter likecomment_form_args
to modify the actual args passed in, we cannot use thecomment_form_defaults
filter to inject amp-bind logic into the form.Longer-term solutions would be to introduce the
comment_form_args
filter to core, or even better to not use amp-bind and instead use amp-script for this.The effect of this PR is that the “Leave a Reply” heading will remain unchanged in Twenty Nineteen and Twenty Twenty when you enter a comment or click a “Reply” link in the comments list. In Twenty Seventeen, which does not pass any arguments to
comment_form()
, the heading will change from “Leave a Reply” to “Leave a Reply to John Smith” when clicking the reply link. In all themes, the “Cancel Reply” link should still appear regardless of the heading changing.Additionally, this PR prevents the amp-bind warning message from appearing:
Fixes #2489.
Checklist