[wp-meta] [Making WordPress.org] #2583: Tagregator filters every request with function that can throw "undefined index" notices

Making WordPress.org noreply at wordpress.org
Wed Mar 15 00:50:38 UTC 2017


#2583: Tagregator filters every request with function that can throw "undefined
index" notices
-------------------------------------+-----------------
 Reporter:  coreymckrill             |      Owner:
     Type:  defect                   |     Status:  new
 Priority:  normal                   |  Milestone:
Component:  WordCamp Site & Plugins  |   Keywords:
-------------------------------------+-----------------
 Tagregator currently has four different "source" classes that it uses to
 aggregate hashtag data. Each of these classes adds a filter to the
 `request` hook so that the items in their Post Lists can be sorted by a
 particular post meta value.
 [https://plugins.trac.wordpress.org/browser/tagregator/trunk/classes/tggr-
 media-source.php#L162 The filter] checks for an `orderby` query var, and
 then compares the source's CPT to the `post_type` query var.

 The problem is that some requests don't have a `post_type` query var, and
 if `WP_DEBUG` is turned on, this will throw an '''Undefined index:
 post_type''' notice, which can be especially problematic for Ajax and REST
 API requests. It also seems a bit overkill to filter every request when
 the sorting is only used on very specific admin screens.

--
Ticket URL: <https://meta.trac.wordpress.org/ticket/2583>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list