Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#32371 closed defect (bug) (duplicate)

allowed_themes filter not consistent on multisite network

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

Description

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 11 years ago.

Download all attachments as: .zip

Change History (4)

#1 @jeremyfelt
11 years ago

  • Component General → 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
11 years ago

  • Resolution → duplicate
  • Status new → closed

Duplicate of #28436.

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

#3 @DrewAPicture
11 years ago

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