Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#32371 closed defect (bug) (duplicate)

allowed_themes filter not consistent on multisite network

Reported by: fliespl Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords: reporter-feedback
Focuses: multisite Cc:
PR Number:


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;
  1. Try to enable it through themes menu.

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

Possible fix included.

Attachments (1)

allowed_themes_inconsistency_fix.patch (1.6 KB) - added by fliespl 5 years ago.

Download all attachments as: .zip

Change History (4)

#1 @jeremyfelt
5 years ago

  • Component changed from General to Themes
  • Focuses multisite added
  • Keywords reporter-feedback added

Hi @fliespl, thanks for the ticket.

I believe this is a duplicate of #28436, as the changes there should correct this. Can you take a look and confirm?

#2 @fliespl
5 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #28436.

Hi @jeremyfelt,
yeah seems that way. Sorry for duplicate - haven't seen that one.

#3 @DrewAPicture
5 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.