Commit Graph

90 Commits

Author SHA1 Message Date
Scott Taylor
71f955dc84 In WP_Comments_List_Table, favor passing WP_Comment instances instead of $comment_ID to template functions. This allows us to bypass unnecessary cache lookups and simply pass the object through when it is set.
See #33638.

Built from https://develop.svn.wordpress.org/trunk@33964


git-svn-id: http://core.svn.wordpress.org/trunk@33933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-09 03:00:24 +00:00
Scott Taylor
d973339738 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.

Built from https://develop.svn.wordpress.org/trunk@33963


git-svn-id: http://core.svn.wordpress.org/trunk@33932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-09 02:51:24 +00:00
Scott Taylor
c1bb5b5ce3 After [33843], update the location of some files in This filter is documented in docs
Props dimadin.
See #33413.

Built from https://develop.svn.wordpress.org/trunk@33954


git-svn-id: http://core.svn.wordpress.org/trunk@33923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-08 22:17:26 +00:00
Scott Taylor
00c8fe6b38 Bump the timeout in trackback() to 10 seconds (from 4) to match wp_xmlrpc_server::pingback_ping() and prevent trackback timeouts.
Props gnaka08 for the initial patch.
Fixes #10414.

Built from https://develop.svn.wordpress.org/trunk@33948


git-svn-id: http://core.svn.wordpress.org/trunk@33917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-08 18:56:25 +00:00
Drew Jaynes
f57d7527e6 Docs: Clarify the file header summary for wp-includes/comment-functions.php, introduced in [33750].
See #33413. See #33701.

Built from https://develop.svn.wordpress.org/trunk@33899


git-svn-id: http://core.svn.wordpress.org/trunk@33868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-04 01:42:24 +00:00
Scott Taylor
e73ee5ac98 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.

Built from https://develop.svn.wordpress.org/trunk@33891


git-svn-id: http://core.svn.wordpress.org/trunk@33860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-03 18:17:24 +00:00
Scott Taylor
6ae78f0fe4 Comments: wp_count_comments() can use get_comment_count() internally to makes its DB query, provided that get_comment_count() returns more properties.
Adds/updates unit tests. There were zero (0) unit tests for `wp_count_comments()`.

Fixes #19903. 

Built from https://develop.svn.wordpress.org/trunk@33822


git-svn-id: http://core.svn.wordpress.org/trunk@33790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-31 18:51:22 +00:00
Scott Taylor
107a7104bd Fix the doc block syntax for the 'wp_get_current_commenter' filter.
Props dimadin.
Fixes #33304.

Built from https://develop.svn.wordpress.org/trunk@33811


git-svn-id: http://core.svn.wordpress.org/trunk@33779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-30 03:21:20 +00:00
Scott Taylor
e49980bdc1 get_comment_count() currently increments awaiting_moderation when comments are in the trash. This occurs because case 0: will match any value passed to switch that is a string that isn't specified in the list of cases. This is terrifying.
* Cases for `0` and `1` should be `'1'` and `'0'`
* Add unit tests for `get_comment_count()`. Currently, there are none.

See #33414.

Built from https://develop.svn.wordpress.org/trunk@33806


git-svn-id: http://core.svn.wordpress.org/trunk@33774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-30 02:19:21 +00:00
Scott Taylor
f07ab12359 Comments: move WP_Comment_Query into its own file. comment.php loads the new files, so this is 100% BC if someone is loading comment.php directly. New files created using svn cp.
Creates: 
`class-wp-comment-query.php` 
`comment-functions.php` 

`comment.php` contains only top-level code. Class file only contains the class. Functions file only contains functions.

See #33413.

Built from https://develop.svn.wordpress.org/trunk@33750


git-svn-id: http://core.svn.wordpress.org/trunk@33718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-26 04:27:21 +00:00
ryan
6027cfa946 Reorg comment functions. #2525
git-svn-id: http://svn.automattic.com/wordpress/trunk@3714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-04-19 02:32:12 +00:00
ryan
d650991531 Move clean_url() to functions-formatting.php. #2525
git-svn-id: http://svn.automattic.com/wordpress/trunk@3713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-04-18 04:58:38 +00:00
ryan
31cb659651 Filter comments when updating. Props mdawaffe.
git-svn-id: http://svn.automattic.com/wordpress/trunk@3662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-03-29 20:41:13 +00:00
ryan
25c2dcac3c More comment cookie sanitation.
git-svn-id: http://svn.automattic.com/wordpress/trunk@3577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-02-28 09:49:06 +00:00
ryan
5322fc2faa current user cleanup
git-svn-id: http://svn.automattic.com/wordpress/trunk@3566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-02-22 19:08:55 +00:00
ryan
34398e5a2e Make sure user_id is set before inserting. Props bungeman. fixes #2459
git-svn-id: http://svn.automattic.com/wordpress/trunk@3537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-02-17 01:00:18 +00:00
ryan
60d01b1f96 Use post_type not post_status.
git-svn-id: http://svn.automattic.com/wordpress/trunk@3535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-02-15 07:16:58 +00:00
ryan
dd202ce1f9 Death to trailing tabs. Props Mark J. fixes #2405
git-svn-id: http://svn.automattic.com/wordpress/trunk@3517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-02-12 07:53:23 +00:00
ryan
d96ba966cd Use ->comments instead of . fixes #2294
git-svn-id: http://svn.automattic.com/wordpress/trunk@3442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-01-16 20:03:56 +00:00
ryan
ba29615e7e Trigger pre_ping action outside of loop. Props Mark Jaquith. fixes #2269
git-svn-id: http://svn.automattic.com/wordpress/trunk@3427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-01-11 21:35:36 +00:00
ryan
ee8b3c94df i18n fixes from SteveAgl. fixes #2207
git-svn-id: http://svn.automattic.com/wordpress/trunk@3393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2006-01-02 21:08:34 +00:00
ryan
00e695e6f5 LJ tweaks.
git-svn-id: http://svn.automattic.com/wordpress/trunk@3375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-12-29 01:25:41 +00:00
ryan
2d9779beba Make sure comment_parent is set.
git-svn-id: http://svn.automattic.com/wordpress/trunk@3331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-12-20 04:28:32 +00:00
ryan
97cd7143da New asyncronous ping method. fixes #2048
git-svn-id: http://svn.automattic.com/wordpress/trunk@3317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-12-16 03:04:33 +00:00
ryan
9d4c41b823 i18n fix from pandem. fixes #2028
git-svn-id: http://svn.automattic.com/wordpress/trunk@3272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-12-05 16:58:26 +00:00
ryan
9dc3881715 Decrease comment count only when deleting approved comments.
git-svn-id: http://svn.automattic.com/wordpress/trunk@3271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-12-05 05:31:27 +00:00
ryan
24e2307445 Instead of incrementing the current comment count, recount all comments to make sure we have a good count. Props Mark Jaquith. fixes #1920
git-svn-id: http://svn.automattic.com/wordpress/trunk@3193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-11-22 03:45:40 +00:00
ryan
f4f22fce81 Attachment cleanups from skeltoac. fixes #1870
git-svn-id: http://svn.automattic.com/wordpress/trunk@3145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-11-18 09:25:47 +00:00
ryan
a370a5d002 i18n fix from nbachiyski. fixes #1874
git-svn-id: http://svn.automattic.com/wordpress/trunk@3125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-11-17 03:01:55 +00:00
ryan
a41c4a693f Add missing space to fix validation. Props seth. fixes #1887
git-svn-id: http://svn.automattic.com/wordpress/trunk@3118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-11-16 23:59:29 +00:00
ryan
5fdc8b56da Add some comment API and update comment popup templates to use them. Props David Hose. fixes #1892
git-svn-id: http://svn.automattic.com/wordpress/trunk@3115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-11-16 23:48:12 +00:00
ryan
25b644e8ce Add comment_count to the posts table. Props donncha. fixes #1860
git-svn-id: http://svn.automattic.com/wordpress/trunk@3104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-11-16 06:29:36 +00:00
matt
682ad94a9f Follow standards in Pingback - fixes #1668
git-svn-id: http://svn.automattic.com/wordpress/trunk@3078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-11-14 10:08:12 +00:00
matt
1301fdf266 More accessible comment links
git-svn-id: http://svn.automattic.com/wordpress/trunk@3065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-11-14 03:06:52 +00:00
matt
9187979859 Moderation and comment_author_link, fixes #1019
git-svn-id: http://svn.automattic.com/wordpress/trunk@3055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-11-13 02:45:53 +00:00
matt
f67be7f30f Don't notify your own comments, fixes #1670
git-svn-id: http://svn.automattic.com/wordpress/trunk@3031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-11-10 23:31:58 +00:00
matt
cdd3a0a295 Allow "anonymous" to be translated, fixes #1740
git-svn-id: http://svn.automattic.com/wordpress/trunk@2986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-11-05 22:53:40 +00:00
ryan
e445ffe7e6 Don't self ping. Props Mark Jaquith fixes #993
git-svn-id: http://svn.automattic.com/wordpress/trunk@2983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-11-05 16:20:09 +00:00
matt
65f1a4df26 Awesome fix from Dougal about ping timeout problems.
git-svn-id: http://svn.automattic.com/wordpress/trunk@2942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-10-10 16:36:54 +00:00
ryan
46df98f327 Typos
git-svn-id: http://svn.automattic.com/wordpress/trunk@2905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-09-22 21:14:52 +00:00
matt
e91046317b Uppercase, please.
git-svn-id: http://svn.automattic.com/wordpress/trunk@2903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-09-22 08:39:09 +00:00
ryan
a34a4ca8c7 wp_insert_comment(), wp_update_comment(), wp_allow_comment(), and wp_filter_comment() from skeltoac. fixes #1683
git-svn-id: http://svn.automattic.com/wordpress/trunk@2894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-09-20 03:17:43 +00:00
ryan
ef29f0ba5f get_comments_number() improvements from markjaquith. fixes #1677
git-svn-id: http://svn.automattic.com/wordpress/trunk@2881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-09-15 23:40:04 +00:00
matt
ab39a0e1ac Make posting faster. Fixes #1580 for 1.6
git-svn-id: http://svn.automattic.com/wordpress/trunk@2828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-08-30 23:19:32 +00:00
ryan
d878c57a30 Call time pass by reference not allowed. Use the array trick. fixes #1583
git-svn-id: http://svn.automattic.com/wordpress/trunk@2798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-08-20 02:01:44 +00:00
matt
5ebbcc659b Adding some hooks, fixes #1489
git-svn-id: http://svn.automattic.com/wordpress/trunk@2743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-08-03 00:40:42 +00:00
ryan
91efba11ad Use wpdb->escape instead of addslashes to prepare DB bound data.
git-svn-id: http://svn.automattic.com/wordpress/trunk@2699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-07-05 20:47:22 +00:00
matt
f048ab7b0a Indentation and correct response link when no comments, fixes #1408
git-svn-id: http://svn.automattic.com/wordpress/trunk@2685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-07-02 23:35:36 +00:00
ryan
ebdf64dce2 Fix WP version in pingbacks. http://mosquito.wordpress.org/view.php?id=1285 Props: error
git-svn-id: http://svn.automattic.com/wordpress/trunk@2575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-04-26 05:51:25 +00:00
matt
5eb42126dd Whitelist from own domain. http://mosquito.wordpress.org/view.php?id=999
git-svn-id: http://svn.automattic.com/wordpress/trunk@2562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2005-04-20 22:01:24 +00:00