require_if_theme_supports
Checks a theme's support for a given feature before loading the functions which implement it.
Description
Parameters (2)
- 0. $feature (string)
- The feature being checked.
- 1. $include (string)
- Path to the file.
Usage
if ( !function_exists( 'require_if_theme_supports' ) ) { require_once ABSPATH . WPINC . '/theme.php'; } // The feature being checked. $feature = ''; // Path to the file. $include = ''; // NOTICE! Understand what this does before running. $result = require_if_theme_supports($feature, $include);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/theme.php
- function require_if_theme_supports( $feature, $include ) {
- if ( current_theme_supports( $feature ) ) {
- require ( $include );
- return true;
- }
- return false;
- }