[wp-trac] [WordPress Trac] #47133: Post's global variables not available on content_pagination filter

WordPress Trac noreply at wordpress.org
Mon May 6 13:43:11 UTC 2019


#47133: Post's global variables not available on content_pagination filter
--------------------------+-----------------------------
 Reporter:  david.binda   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This is related to the same issue flagged in #47114 .

 After r44941 the post's global variables are being defined after the
 `content_pagination` filter fires due to the same reasoning as in #47114.

 I personally haven't experienced any issues, but I was able to find a code
 on GitHub which would break due to the issue.

 A textPager plugin, available on GitHub (last update was 3 years ago,
 tho), [https://github.com/R-Harada/textPager/blob/master/textPager.php#L18
 hooks `content_pagination` filter] and on it's callback, it
 [https://github.com/R-Harada/textPager/blob/master/class/nextPager.php#L16
 attempts to read the `global $page` variable], which has not been properly
 set yet (after r44941).

 I'm not sure how often such a logic relying on global variables being set
 is used (the example I linked is the only one I've been able to find), so
 I'm not sure on the severity here.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47133>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list