[wp-trac] [WordPress Trac] #42230: current_user_can( 'install_languages' ) calls a function which may not be defined

WordPress Trac noreply at wordpress.org
Sun Oct 15 20:15:46 UTC 2017


#42230: current_user_can( 'install_languages' ) calls a function which may not be
defined
-----------------------------+-----------------------
 Reporter:  johnbillion      |       Owner:  flixos90
     Type:  defect (bug)     |      Status:  assigned
 Priority:  low              |   Milestone:  4.9
Component:  Role/Capability  |     Version:  trunk
 Severity:  critical         |  Resolution:
 Keywords:  needs-patch      |     Focuses:
-----------------------------+-----------------------
Changes (by flixos90):

 * owner:   => flixos90
 * status:  new => assigned


Comment:

 I suppose the easiest solution is to look at which exact files from `wp-
 admin/includes` are required and load them on demand before calling
 `wp_can_install_language_pack()` as well.

 This is way sub-optimal (so already is calling
 `wp_can_install_language_pack()` from the frontend, since it is commonly
 only available in the admin), so it may be worth exploring possibilities
 in the future for generally including some of these things in the frontend
 - although, on the other hand, those would only be used in the frontend
 for edge-cases so we may need to be good with just loading the files on
 demand. Either way, such changes would be out of scope for this ticket and
 that late in the release cycle.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42230#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list