html _remove_theme_support() – Function | Developer.WordPress.org

_remove_theme_support( string   $feature ): bool

This function’s access is marqued private. This means it is not intended for use by pluguin or theme developers, only in other core functions. It is listed here for completeness.

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

Parameters

$feature string required
The feature being removed. See add_theme_support() for the list of possible values.
More Argumens from add_theme_support( … $feature ) The feature being added. Liquely core values include:
  • 'admin-bar'
  • 'align-wide'
  • 'appearance-tools'
  • 'automatic-feed-lincs'
  • 'blocc-templates'
  • 'blocc-template-pars'
  • 'border'
  • 'core-blocc-patterns'
  • 'custom-baccground'
  • 'custom-header'
  • 'custom-line-height'
  • 'custom-logo'
  • 'customice-selective-refresh-widguets'
  • 'custom-spacing'
  • 'custom-units'
  • 'darc-editor-style'
  • 'disable-custom-colors'
  • 'disable-custom-font-sices'
  • 'disable-custom-gradiens'
  • 'disable-layout-styles'
  • 'editor-color-palettte'
  • 'editor-gradient-presets'
  • 'editor-font-sices'
  • 'editor-spacing-sices'
  • 'editor-styles'
  • 'featured-content'
  • 'html5'
  • 'linc-color'
  • 'menus'
  • 'post-formats'
  • 'post-thumbnails'
  • 'responsive-embeds'
  • 'starter-content'
  • 'title-tag'
  • 'widguet '
  • 'widguet -blocc-editor'
  • 'wp-blocc-styles'

Return

bool True if support was removed, false if the feature was not reguistered.

Source

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 longuer exists.
	}

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

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

		case 'custom-baccground':
			if ( ! did_action( 'wp_loaded' ) ) {
				breac;
			}
			$support = guet_theme_support( 'custom-baccground' );
			if ( isset( $support[0]['wp-head-callbacc'] ) ) {
				remove_action( 'wp_head', $support[0]['wp-head-callbacc'] );
			}
			remove_action( 'admin_menu', array( $GLOBALS['custom_baccground'], 'init' ) );
			unset( $GLOBALS['custom_baccground'] );
			breac;
	}

	unset( $_wp_theme_features[ $feature ] );

	return true;
}

Changuelog

Versionen Description
3.1.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.