Scott Taylor
15935e0aed
Comments: in comment_form(), add args for cancel_reply_before and cancel_reply_after to eradicate remaining hard-coded HTML bits.
...
Props MikeHansenMe.
Fixes #23797 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34523 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-24 21:32:03 +00:00
Scott Taylor
55bb8b8c0b
Comments: add a 'comment_excerpt_length' filter to get_comment_excerpt().
...
Create the first ever unit tests for `get_comment_excerpt()`.
Props dannydehaan, wonderboymusic.
Fixes #27526 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34520 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-24 21:04:16 +00:00
Scott Taylor
ba2842f326
Comments: In comments_template(), set $wp_query->comments_by_type to empty array if not separating comments. The value becomes stale otherwise. Edge case.
...
Props jakub.tyrcha.
Fixes #14809 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34503 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-24 16:30:12 +00:00
Boone Gorges
e6b7c6b2d4
Bail early when invalid ID is passed to get_comment_class().
...
This helps to avoid PHP notices later in the function.
Props walterebert, dipesh.kakadiya, DrewAPicture.
Fixes #33947 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34454 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-23 14:08:47 +00:00
Scott Taylor
27eb1ac0da
Add title_reply_before and title_reply_after args to comment_form() to allow the "Leave a Reply" heading level to be changed.
...
Props tyxla.
Fixes #33775 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34308 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-18 19:17:19 +00:00
Boone Gorges
504deb52fc
Lazy-load comment meta on single post pages.
...
[34268] introduced cache priming for commentmeta, enabled by default. To
ensure performance on single post pages - where commentmeta is most likely
to cause performance issues - we disable up-front cache-priming. Instead, we
prime commentmeta caches for all comments in the loop the first time
`get_comment_meta()` is called on the page.
Props bradt, dd32, wonderboymusic, boonebgorges.
Fixes #16894 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34270 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 20:00:31 +00:00
Scott Taylor
3ca5bbb585
Revert [33925], by-reference array manipulation is breaking comments in some themes.
...
This implementation is losing its shine.
See #16894 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34245 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 18:13:19 +00:00
Drew Jaynes
2b6dc75396
Docs: Add changelog entries for parameters where WP_Comment object support was added in [33961].
...
See #33638 . See #32246 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34237 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 13:51:13 +00:00
Scott Taylor
e05586646a
Apply the new 'respond_link' filter in comments_popup_link() if $number is 0 before outputting the URL.
...
Props joedolson.
Fixes #29454 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34216 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-15 20:45:32 +00:00
Scott Taylor
b76864660c
Comments: get_comments_link() should return a link with #respond as the hash instead of #comments if get_comments_number() returns 0.
...
Props cgrymala, wonderboymusic.
Fixes #19893 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34075 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-12 07:35:05 +00:00
Scott Taylor
0f2078bc9e
When clicking "Show More Comments" in the Comments meta box on the Edit Post screen, change the click behavior to call a new class method on commentsBox, ->load(), that resets st (cool name) to the number of visible <tr>s before calling ->get(). This will account for spam'd and trash'd comments when returning comments at the proper offset.
...
Props utkarshpatel.
Fixes #33829 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34069 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-12 02:27:50 +00:00
Scott Taylor
db702bc3ea
After [33961], pass $comment to get_comment_author_link() where possible to avoid extra cache/db lookups.
...
See #33638 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34039 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-11 06:04:22 +00:00
Scott Taylor
47287f8d51
After [33961], ensure that comment filters that expect a comment ID are receiving one.
...
Props dimadin.
Fixes #33809 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34008 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-10 18:09:15 +00:00
Scott Taylor
38d374ab01
After [33891], get_comment() returns global $comment if no args are passed and the global is set (after setting the default to null here). This allows us to ditch global comment imports.
...
See #33638 .
git-svn-id: https://develop.svn.wordpress.org/trunk@33963 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-09 02:50:43 +00:00
Scott Taylor
8088ffafd6
Walker_Comment should be in its own file. Loaded now via wp-includes/comment.php, which makes it 100% BC.
...
See #33413 .
git-svn-id: https://develop.svn.wordpress.org/trunk@33962 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-09 02:40:53 +00:00
Scott Taylor
95247e5bd8
After [33891], a lot of comment functions can take WP_Comment instead of only accepting comment_ID. Update the @param docs to reflect this.
...
See #33638 .
git-svn-id: https://develop.svn.wordpress.org/trunk@33961 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-09 02:33:19 +00:00
Scott Taylor
542ac152fc
In wp_list_comments(), update the comment meta cache when the comments derive from WP_Query and the new ->comment_meta_cached prop is false.
...
There are no uses of `wp_list_comments()` in Core where `$comments` are passed as the 2nd argument.
Adds unit tests.
Props wonderboymusic, bradt.
Fixes #16894 .
git-svn-id: https://develop.svn.wordpress.org/trunk@33925 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-05 22:24:16 +00:00
Sergey Biryukov
f8f8de0ecf
Merge two strings in Walker_Comment::comment() and Walker_Comment::html5_comment().
...
Props pavelevap.
Fixes #33744 .
git-svn-id: https://develop.svn.wordpress.org/trunk@33919 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-05 20:45:13 +00:00
Scott Taylor
60ba8b05e4
Introduce WP_Comment class to model/strongly-type rows from the comments database table. Inclusion of this class is a pre-req for some more general comment cleanup and sanity.
...
* Takes inspiration from `WP_Post` and adds sanity to comment caching.
* Clarifies when the current global value for `$comment` is returned. The current implementation in `get_comment()` introduces side effects and an occasion stale global value for `$comment` when comment caches are cleaned.
* Strongly-types `@param` docs
* This class is marked `final` for now
Props wonderboymusic, nacin.
See #32619 .
git-svn-id: https://develop.svn.wordpress.org/trunk@33891 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-03 18:16:35 +00:00
Sergey Biryukov
dcc6fb838f
Restore rel='nofollow' for comment reply links to reduce extra crawling by search engines.
...
This reverts [16230], which didn't have enough review at the time of commit.
props joostdevalk.
see #22889 , #18547 , #16881 .
git-svn-id: https://develop.svn.wordpress.org/trunk@33047 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-02 11:08:42 +00:00
Mark Jaquith
fcd4f3ea0f
Revert [33038] because of objections raised on #22889 and #31590
...
git-svn-id: https://develop.svn.wordpress.org/trunk@33042 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-02 00:46:28 +00:00
Mark Jaquith
165b3fccaa
Restore $noreplytext default value in comment_form_title()
...
props ocean90
see #22889
git-svn-id: https://develop.svn.wordpress.org/trunk@33039 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-01 21:50:13 +00:00
Mark Jaquith
bac0e68b48
Say goodbye to ?replytocom=123 links and their URL pollution.
...
* Comment reply links continue to use JS as before.
* ?replytocom=123 links are deprecated.
props joostdevalk
fixes #22889
git-svn-id: https://develop.svn.wordpress.org/trunk@33038 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-01 21:41:17 +00:00
Konstantin Obenland
59a9592125
Remove allowed tags from comment form.
...
It can be confusing to users and for most it is not relevant.
Commenters comfortable with HTML will know which tags are likely
to be accepted.
Props krogsgard, rachelbaker.
Fixes #30157 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32858 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-19 14:14:41 +00:00
Scott Taylor
e88721433c
In get_comment_reply_link(), when generating the reply link, add the replytocom query arg to the result of get_permalink() on the current $post, instead of the current global request URI.
...
Props nazmul.hossain.nihal.
Fixes #31333 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32786 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-16 00:18:39 +00:00
Andrew Nacin
cda77232fe
Update comment caches in WP_Comment_Query, rather than comments template.
...
props dd32.
fixes #31081 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32769 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-14 19:20:12 +00:00
Scott Taylor
39ef6a72c5
Use void instead of null where appropriate when pipe-delimiting @return types. If a @return only contains void, remove it.
...
See #32444 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32568 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-24 05:39:47 +00:00
Scott Taylor
abca40cf44
Add missing doc blocks to comment-template.php.
...
See #32444 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32567 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-24 05:18:59 +00:00
Sergey Biryukov
09bd58b4c9
In comment_form(), ensure that filtered arguments contain all required default values.
...
props boonebgorges.
fixes #32312 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@32511 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-19 01:03:39 +00:00
Sergey Biryukov
2848b8a911
Replace echo __() with _e().
...
props marsjaninzmarsa.
fixes #32239 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32333 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-03 16:17:06 +00:00
Helen Hou-Sandi
3fb766782d
Don't add a class for comment authors who are members of the current site.
...
Reverts [32245] and [31518]. We'll keep the whitespace and comment clarification, though.
see #24054 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32259 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-21 23:35:55 +00:00
Helen Hou-Sandi
10640611f6
Comment: rename the comment-author-is-site-member class to bysiteuser for consistency.
...
Final decision on keeping the class yet to be made.
props DrewAPicture.
see #24054 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32245 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-21 14:19:58 +00:00
Drew Jaynes
e984069608
Remove backtick-escaping around a core function in the hook docs for the comment_form_submit_field filter.
...
See [31699]. See #31888 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32037 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-05 15:38:57 +00:00
Dominik Schilling (ocean90)
a3f6767a45
Comments: Move HTML tags for screen reader text into translatable strings.
...
Placeholders aren't helpful and it's much easier to make a mistake if you're dealing with placeholders.
Introduced in [31388].
props pento.
fixes #26553 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31821 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-18 21:51:36 +00:00
Drew Jaynes
b9cb22f888
Add a changelog entry to the DocBlock for comment_form() for the class_submit argument added in 4.1.
...
See [29809]. See #20446 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31803 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-17 18:37:12 +00:00
Boone Gorges
8072fe7db6
Improved customizability for the Submit button in comment_form().
...
The new 'submit_button' and 'submit_field' parameters for `comment_form()`
allow developers to modify the markup of the submit button and its wrapper.
These params are accompanied by targeted 'comment_form_submit_button' and
'comment_form_submit_field' filters on the concatenated markup.
Props coffee2code, morpheu5, DrewAPicture, boonebgorges.
Fixes #15015 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31699 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-10 19:07:31 +00:00
Jeremy Felt
a86c3114ae
Add comment-author-is-site-member class to comment output for site members.
...
Add a class to allow targeting of comments made by members of a site rather than users of the entire network.
Props Viper007Bond, MikeHansenMe.
Fixes #24054 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31518 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-23 02:51:49 +00:00
Sergey Biryukov
5aac59d178
Replace hardcoded usage of comment-page with the comment pagination base.
...
props johnbillion, SergeyBiryukov, webord.
fixes #18084 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31459 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-14 03:47:02 +00:00
Sergey Biryukov
5d35c181dc
Add .comment-reply-login class to get_post_reply_link(), for consistency with get_comment_reply_link().
...
props johnjamesjacoby.
fixes #31298 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31412 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 16:10:54 +00:00
Sergey Biryukov
c8a361712b
Switch to a string placeholder, as number_format_i18n() returns a string.
...
see #26553 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31402 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-10 05:44:21 +00:00
Sergey Biryukov
74ad70419e
Use _n() in comments_popup_link() when setting the default string to display if there are more than one comment.
...
see #26553 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31401 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-10 02:50:58 +00:00
Aaron Jorbin
5abd98618d
Add translator comments for new strings.
...
These strings were added in [31388].
Props ocean90.
Fixes 26553.
git-svn-id: https://develop.svn.wordpress.org/trunk@31389 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-09 20:14:19 +00:00
Aaron Jorbin
cf09359d34
Use screen reader text instead of a title attribute in comments_popup_link
...
To better understand screen reader text, check out https://make.wordpress.org/accessibility/2015/02/09/hiding-text-for-screen-readers-with-wordpress-core/
Screen Reader text improves the user experience for screen reader users. It provides additional context for links, document forms and other pieces of a page that may exist visually, but are lost when looking only at the html of a site. This does change the output of comments_popup_link if you don't pass in values for $zero, $one, $more or $none. Theme authors can and should style <code>.screen-reader-text</code> in ways that are recommended in the above article to hide it visually.
Props joedolson
Fixes #26553
git-svn-id: https://develop.svn.wordpress.org/trunk@31388 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-09 19:26:56 +00:00
Scott Taylor
db1ace58ca
In comment_form(), add the HTML5 required attribute next to aria-required in fields that utilize it.
...
Props MMN-o.
Fixes #24732 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31204 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 15:55:50 +00:00
Sergey Biryukov
c96947757a
Remove a redundant inline comment with a typo.
...
props nicnicnicdevos.
fixes #30956 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31103 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-08 21:28:11 +00:00
Scott Taylor
6fd11624d1
The keyword elseif should be used instead of else if so that all control keywords look like single words.
...
This was a mess, is now standardized across the codebase, except for a few 3rd-party libs.
See #30799 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31090 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-08 07:04:40 +00:00
Scott Taylor
fdef2cc755
Remove whitespace side effects from comment_form().
...
Props timersys.
Fixes #30500 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31036 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-03 06:26:38 +00:00
Drew Jaynes (DrewAPicture)
205a43ed05
Correctly capitalize JavaScript throughout core docs.
...
Fixes #30569 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30695 602fd350-edb4-49c9-b593-d223f7449a82
2014-12-02 00:30:59 +00:00
Scott Taylor
4d46475b3d
Improve various @param docs for src/wp-includes/*.
...
See #30224 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30681 602fd350-edb4-49c9-b593-d223f7449a82
2014-12-01 01:33:34 +00:00
Drew Jaynes (DrewAPicture)
e587324180
Docs Formatting: Backtick-escape inline code for all remaining dynamic hook docs in wp-includes/*.
...
Affects DocBlocks for the following hooks:
* `auth_post_meta_{$meta_key}`
* `term_links-$taxonomy`
* `customize_render_control_ . $this->id`
* `customize_render_panel_{$this->id}`
* `customize_render_section_{$this->id}`
* `customize_preview_{$this->id}`
* `customize_save_ . $this->id_data[ 'base' ]`
* `customize_update_ . $this->type`
* `customize_value_ . $this->id_data[ 'base' ]`
* `customize_sanitize_js_{$this->id}`
* `comment_form_field_{$name}`
* `comment_{$old_status}_to_{$new_status}`
* `comment_{$new_status}_{$comment->comment_type}`
* `extra_{$context}_headers`
* `get_template_part_{$slug}`
* `get_the_generator_{$type}`
* `get_{$adjacent}_post_join`
* `get_{$adjacent}_post_where`
* `get_{$adjacent}_post_sort`
* `{$adjacent}_post_rel_link`
* `{$adjacent}_post_link`
* `{$adjacent}_image_link`
* `blog_option_{$option}`
* `$permastructname . _rewrite_rules`
* `{$type}_template`
* `theme_mod_{$name}`
* `pre_set_theme_mod_$name`
* `current_theme_supports-{$feature}`
* `get_user_option_{$option}`
* `edit_user_{$field}`
* `pre_user_{$field}`
* `user_{$field}`
See #30552 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30656 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-30 12:09:56 +00:00