[wp-trac] [WordPress Trac] #53395: Cannot use wp_is_mobile() in Network activated plugins

WordPress Trac noreply at wordpress.org
Mon Jun 14 10:31:25 UTC 2021


#53395: Cannot use wp_is_mobile() in Network activated plugins
--------------------------+-----------------------------
 Reporter:  promz         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Steps to reproduce

 - Create a network site
 - Create and activate a simple custom plugin, use wp_is_mobile() function
 anywhere in that plugin
 - Login to the network dashboard and then activate the plugin

 You will see an error:

 Uncaught Error: Call to undefined function wp_is_mobile()

 Looking at the source code of wp_is_mobile(), I can't see anything that
 would prevent it from loading earlier. Maybe it should be loaded earlier?

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


More information about the wp-trac mailing list