[wp-trac] [WordPress Trac] #54381: Add filter to validate_theme_requirements

WordPress Trac noreply at wordpress.org
Fri Nov 5 05:00:33 UTC 2021


#54381: Add filter to validate_theme_requirements
-------------------------+-----------------------------
 Reporter:  kraftbj      |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Themes       |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 There may be the need to add extra requirements for a theme to validate
 that site administrators may want to add. The
 `validate_theme_requirements` function looks keen for this, but there are
 currently no hooks in the function.

 An example use case: A particular site on a multisite should never have a
 theme changed via the UI (a mission-critical site). The multisite,
 generally, has various themes network activated. Such a filter could allow
 a site administrator to check the blog ID and return a WP_Error if the
 blog ID is in a "theme_change_disallowed" array.

 Proposing a `validate_theme_requirement` filter that hooks at the end of
 the current function to allow additional validation requirements.
 Intentionally not filtering the current failing conditions (incompatible
 WP or PHP) to prevent poor implementation of the filter to lead to a
 PHP/WP version-related fatal.

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


More information about the wp-trac mailing list