Make WordPress Core


Ignore:
Timestamp:
10/20/2025 10:29:35 PM (11 months ago)
Author:
jorbin
Message:

Plugins and Themes: Add filters to validation functions.

It is now possible to add additional validation requirements for themes and plugins besides the built in core checks.

Developed in https://github.com/WordPress/wordpress-develop/pull/1812 and https://github.com/WordPress/wordpress-develop/pull/10361.

Props kraftbj, mukesh27, jorbin, joedolson.
Fixes #54381.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme.php

    r60979 r60995  
    10031003        }
    10041004
    1005         return true;
     1005        /**
     1006         * Filters the theme requirement validation response.
     1007         *
     1008         * If a theme fails due to a Core-provided validation (incompatible WP, PHP versions), this
     1009         * filter will not fire. A WP_Error response will already be returned.
     1010         *
     1011         * This filter is intended to add additional validation steps by site administrators.
     1012         *
     1013         * @since 6.9.0
     1014         *
     1015         * @param bool|WP_Error $met_requirements True if the theme meets requirements, WP_Error if not.
     1016         * @param string $stylesheet Directory name for the theme.
     1017         */
     1018        return apply_filters( 'validate_theme_requirements', true, $stylesheet );
    10061019}
    10071020
Note: See TracChangeset for help on using the changeset viewer.