Opened 14 years ago
Closed 9 years ago
#14510 closed enhancement (maybelater)
comment_notes_before does not work.
Reported by: | hotforwords | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0.1 |
Component: | Comments | Keywords: | needs-patch dev-feedback |
Focuses: | Cc: |
Description
I am unable to get the comment_notes_before to work.
Using the code:
comment_form(array( 'comment_notes_before' => 'some text' ));
... does not work. it just leaves the default text there.
comment_form(array( 'comment_notes_after' => 'some text' ));
... does work. It allows you to put whatever text you want.
Attachments (3)
Change History (21)
#1
@
14 years ago
I suspect what you're looking at is the logged in view, where comment_notes_before is not shown. However, since this is inconsistent with comment_notes_after, I've added a quick patch which just moves the before bit out of the if test.
There may be a desire to play about with where the field belongs, or debate over whether it should be shown for the logged in user, etc.. (I.E. Is it a bug or not?)
#3
@
14 years ago
- Cc yoavf added
+1 - the inconsistency with comment_notes_after is confusing and should be fixed
#5
@
14 years ago
Patch makes sense to me -- positioning is inconsistent and doesn't make sense for likely use-cases of that text block.
#7
@
14 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
This change breaks the display of the required fields text:
$required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' );
It is now shown whether or not the commenter is logged in rather than only for logged our commenters.
#8
@
14 years ago
All the core default comment_notes are for logged out users.
We probably need to add a new action for them if we are going to move this one.
Reverting for now
#10
@
14 years ago
- Component changed from General to Comments
- Type changed from defect (bug) to enhancement
#12
in reply to:
↑ 11
;
follow-up:
↓ 13
@
14 years ago
- Keywords needs-patch added; has-patch removed
- Milestone changed from 3.1 to Future Release
Replying to nacin:
Punt?
I think so - I'm not sure how to do this easily while keeping back compat on the current functionality.
We probably need a new arg rather than moving the current one.
#13
in reply to:
↑ 12
@
14 years ago
Replying to westi:
Replying to nacin:
Punt?
I think so - I'm not sure how to do this easily while keeping back compat on the current functionality.
We probably need a new arg rather than moving the current one.
Maybe give a value to the arg only if the user is not logged in?
Attaching a tentative patch. I don’t like the ternary nesting very much, but that’s the only way I can think of that does not require an extra arg.
#14
@
14 years ago
This isn't backwards compatible though. One man's broken comment_notes_before (as reported here) is another man's logged-out comment_notes_before.
#15
@
14 years ago
I see.
But now I have another question. Does P2 use comment_form() in an optimal way? Why not do something like the following?
First:
function p2_comment_form_defaults($args) { $args['comment_notes_after'] = ''; $args['comment_notes_before'] = '<p>' . __('Blah blah') . '</p>'; # Etc. etc. return $args; }
Then:
add_filter('comment_form_defaults', 'p2_comment_form_defaults');
And then simply:
comment_form();
This is a genuine question, not a rhetorical one. :-)
move the comment notes before maybe