[wp-trac] [WordPress Trac] #32371: allowed_themes filter not consistent on multisite network

WordPress Trac noreply at wordpress.org
Wed May 13 14:33:09 UTC 2015


#32371: allowed_themes filter not consistent on multisite network
--------------------------+-----------------------------
 Reporter:  fliespl       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Using allowed_themes filter allows only to set themes which are displayed
 for choosing.

 Unfortunately if we add single exclusive theme for just one blog - user
 can't use it.

 This is due to check in "is_allowed" method of WP_Theme class. It doesn't
 involve allowed_themes filter and fails with "Cheating, huh?" warning.


 Steps to reproduce:

 1. Use filter to add exclusive blog:
 {{{
 add_filter('allowed_themes', function($tpls) {
    if(logic) {
       $tpls['exclusive_theme'] = true;
    }
    return $tpls;
 }
 }}}

 2. Try to enable it through themes menu.

 Expected result: theme is changed
 What happens instead: "Cheating, huh?" warning is displayd.



 Possible fix included.

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


More information about the wp-trac mailing list