[wp-trac] [WordPress Trac] #34475: get_comment_link incorrect page number in returned url.

WordPress Trac noreply at wordpress.org
Wed Oct 28 17:13:09 UTC 2015


#34475: get_comment_link incorrect page number in returned url.
-------------------------------+------------------------------
 Reporter:  Property118        |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Comments           |     Version:  4.3.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by Property118):

 Replying to [comment:5 boonebgorges]:
 > Where are you putting the `commenttest()` code for testing? And where
 does Comment Notifier Plugin run its query? Is it inside of a template?
 There are some flags in `get_comment_link()` (like `$in_comment_loop`)
 that are meant to speed the function up, but could be causing problems
 with leaky globals if they're called in certain nested ways.

 the commenttest() function is on a page called cron-test (it was being
 used for crontasks and iv just reused it for this).
 http://www.property118.com/cron-test/

 the code in the notifier plugin is:
 {{{#!php
 <?php
 $data = new stdClass();
     $data->post_id = $post_id;
     $data->title = $post->post_title;
     $data->link = get_permalink($post_id);
     $data->comment_link = $data->link . '#comment-' . $comment_id;
     $data->comment_link = get_comment_link($comment_id,
 array('per_page'=>10));
 }}}

 after that the data variable is used to populate an email, nothing out of
 the ordinary there.

 Thanks

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34475#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list