WordPress at a glance
function is not described

_remove_theme_support() WP 3.1.0

Do not use. Removes theme support internally without knowledge of those not used by themes directly.

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.

Return

true|false. True if support was removed, false if the feature was not registered.

Usage

_remove_theme_support( $feature );
$feature(string) (required)
The feature being removed. See add_theme_support() for the list of possible values.

Notes

  • Global. Array. $_wp_theme_features
  • Global. Custom_Image_Header. $custom_image_header
  • Global. Custom_Background. $custom_background

Changelog

Since 3.1.0 Introduced.

Code of _remove_theme_support() WP 5.7.2

<?php
function _remove_theme_support( $feature ) {
	global $_wp_theme_features;

	switch ( $feature ) {
		case 'custom-header-uploads':
			if ( ! isset( $_wp_theme_features['custom-header'] ) ) {
				return false;
			}
			add_theme_support( 'custom-header', array( 'uploads' => false ) );
			return; // Do not continue - custom-header-uploads no longer exists.
	}

	if ( ! isset( $_wp_theme_features[ $feature ] ) ) {
		return false;
	}

	switch ( $feature ) {
		case 'custom-header':
			if ( ! did_action( 'wp_loaded' ) ) {
				break;
			}
			$support = get_theme_support( 'custom-header' );
			if ( isset( $support[0]['wp-head-callback'] ) ) {
				remove_action( 'wp_head', $support[0]['wp-head-callback'] );
			}
			if ( isset( $GLOBALS['custom_image_header'] ) ) {
				remove_action( 'admin_menu', array( $GLOBALS['custom_image_header'], 'init' ) );
				unset( $GLOBALS['custom_image_header'] );
			}
			break;

		case 'custom-background':
			if ( ! did_action( 'wp_loaded' ) ) {
				break;
			}
			$support = get_theme_support( 'custom-background' );
			if ( isset( $support[0]['wp-head-callback'] ) ) {
				remove_action( 'wp_head', $support[0]['wp-head-callback'] );
			}
			remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) );
			unset( $GLOBALS['custom_background'] );
			break;
	}

	unset( $_wp_theme_features[ $feature ] );

	return true;
}