public function addRemoveThemeSupport($key, $props = [])
    {
        // Setup theme
        add_action('after_setup_theme', function () use ($key, $props) {
            // Check props
            if (is_bool($props) && !$props) {
                // Remove theme support
                remove_theme_support($key);
            } else if (empty($props)) {
                // Add theme support with default configuration
                add_theme_support($key);
            } else {
                // Add theme support with configurations
                add_theme_support($key, $props);
            }
        });
    }
public function addRemoveThemeSupport($key, $props = [])
    {
        // Setup theme
        add_action('after_setup_theme', function () use ($key, $props) {
            // Check props
            if (is_bool($props) && !$props) {
                // Remove theme support
                remove_theme_support($key);
            } else if (empty($props)) {
                // Add theme support with default configuration
                add_theme_support($key);
            } else {
                // Add theme support with configurations
                add_theme_support($key, $props);
            }
        });
    }
public function addRemoveThemeSupport ( $ key , $ props = [ ] ) { // Setup theme add_action ( 'after_setup_theme' , function ( ) use ( $ key , $ props ) { // Check props if ( is_bool ( $ props ) && ! $ props ) { // Remove theme support remove_theme_support ( $ key ) ; } else if ( empty ( $ props ) ) { // Add theme support with default configuration add_theme_support ( $ key ) ; } else { // Add theme support with configurations add_theme_support ( $ key , $ props ) ; } } ) ; }
Add theme supports to WP.

@param string        $key
@param array|boolean $props
Add theme supports to WP .