[glotpress-updates] [GlotPress] #249: Filter routes can't be used by a plugin

GlotPress noreply at wordpress.org
Mon Apr 27 09:39:44 UTC 2015

#249: Filter routes can't be used by a plugin
  Reporter:  markoheijnen  |      Owner:
      Type:  defect        |     Status:  new
  Priority:  normal        |  Milestone:  1.0
 Component:  General       |    Version:
Resolution:                |   Keywords:

Comment (by markoheijnen):

 Replying to [comment:12 yoavf]:
 > Replying to [comment:11 markoheijnen]:
 > > This should not break when plugins using the plugins_loaded hook.
 > True, but in a few plugins that I've written I've added routes by
 calling ```GP::$router->add()``` in the plugin constructor. If it was just
 me, I would ignore it, but I saw it in some plugins by others, too.

 I assumed as much. Thats why the other solution would be to remove the
 filter. Another (ugly) solution would be to rewrite GP_Router a bit and
 call the method `default_routes()` ourself. We then can go to ignore all
 added routes or by adding the defauls on the bottom.

 Personally I go with the current patch since it's a common mistake to call
 something directly in the constructor. Unsure if that is a good

Ticket URL: <https://glotpress.trac.wordpress.org/ticket/249#comment:13>
GlotPress <https://glotpress.trac.wordpress.org>
Easy comin', easy goin'

More information about the glotpress-updates mailing list