uncatcrea / wp-appkit

WP-AppKit WordPress plugin (create mobile apps connected to WordPress)
http://uncategorized-creations.com/
194 stars 66 forks source link

Sanitize default screen fragment to avoid "#" prefix issues when comparing routes #364

Open mleroi opened 6 years ago

mleroi commented 6 years ago

We should systematically remove the "#" prefix from default_route in Router.setDefaultRoute() to be consistent with the fact that routes don't have a "#" prefix (as opposed to fragments).

For now if the default route is set by core from default component it starts with a "#". If we customize default route with 'default-route' filter in theme, it does not start with a "#"...

This leads to wrong comparison in TemplateTags.isDefaultScreen() for example.

(And this TemplateTags.isDefaultScreen() function should be adjusted once the fix on setDefaultRoute() is made)