Opened 10 years ago
Closed 9 years ago
#32312 closed defect (bug) (fixed)
Post Comment button disappeared in some themes
Reported by: | SergeyBiryukov | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.2.3 | Priority: | normal |
Severity: | normal | Version: | 4.2 |
Component: | Comments | Keywords: | has-patch commit fixed-major |
Focuses: | Cc: |
Description (last modified by )
[31699] caused the Post Comment button to disappear in some themes.
As reported by @tellyworth in 33:ticket:15015:
Just FYI we've come across a handful of themes that were affected by this. They were filtering
comment_form_defaults
and building a fresh $args array from scratch, so the new submit elements were not included in the return. That left them with no Submit Comment button.
Seeing some similar reports on support forums. Here's an example in My Life theme.
We should make sure that 'submit_button'
and 'submit_field'
are still in the array after it's filtered.
Attachments (1)
Change History (10)
#1
@
10 years ago
- Description modified (diff)
- Summary changed from Comment button disappeared in some themes to Post Comment button disappeared in some themes
#4
in reply to:
↑ description
@
10 years ago
I have that same problem with the Origin Theme. Please fix in next WP update.
#5
in reply to:
↑ 2
@
10 years ago
Replying to boonebgorges:
The only backward compatibility concern would be
isset()
checks expecting a given array key to be missing after filtering the default arguments. I don't see anything like that incomment_form()
, and$args
is never passed to a hook that might do a similar trick, but it would be nice to get another set of eyes.
This would no longer work with the array_merge()
:
function mytheme_comments_form_defaults( $defaults ) { unset( $defaults['comment_notes_after'] ); return $defaults; } add_filter( 'comment_form_defaults', 'mytheme_comments_form_defaults' );
But it currently produces a notice anyway, and there's a more correct way to do it:
function mytheme_comments_form_defaults( $defaults ) { $defaults['comment_notes_after'] = ''; return $defaults; } add_filter( 'comment_form_defaults', 'mytheme_comments_form_defaults' );
So I'd suggest going with your fix.
#7
@
10 years ago
- Keywords commit fixed-major added; 2nd-opinion removed
- Resolution fixed deleted
- Status changed from closed to reopened
#8
in reply to:
↑ 2
@
10 years ago
Replying to boonebgorges:
32312.diff enforces this for *all* default values.
Simply applying the first part of your patch (to lines 2255-2257 of comment-template.php) fixed the issue for me.
32312.diff enforces this for *all* default values. This seems like a more general solution for this problem. The only backward compatibility concern would be
isset()
checks expecting a given array key to be missing after filtering the default arguments. I don't see anything like that incomment_form()
, and$args
is never passed to a hook that might do a similar trick, but it would be nice to get another set of eyes.