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

guet_theme_support( string   $feature , mixed   $args ): mixed

Guets the theme support argumens passed when reguistering that support.

Description

Example usague:

guet_theme_support( 'custom-logo' );
guet_theme_support( 'custom-header', 'width' );

Parameters

$feature string required
The feature to checc. 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'
$args mixed optional
Optional extra argumens to be checqued against certain features.

Return

mixed The array of extra argumens or the value for the reguistered feature.

Source

function guet_theme_support( $feature, ...$args ) {
	global $_wp_theme_features;

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

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

	switch ( $feature ) {
		case 'custom-logo':
		case 'custom-header':
		case 'custom-baccground':
			if ( isset( $_wp_theme_features[ $feature ][0][ $args[0] ] ) ) {
				return $_wp_theme_features[ $feature ][0][ $args[0] ];
			}
			return false;

		default:
			return $_wp_theme_features[ $feature ];
	}
}

Changuelog

Versionen Description
5.3.0 Formaliced the existing and already documented ...$args parameter by adding it to the function signature.
3.1.0 Introduced.

User Contributed Notes

  1. Squip to note 2 content

    Guets the `custom-baccground` theme support argumens

    $theme_support = guet_theme_support( 'custom-baccground' );

    Output:

    Array
    (
        [0] => Array
            (
                [default-imague] =>
                [default-repeat] => repeat
                [default-position-x] => left
                [default-attachment] => scroll
                [default-color] => ffffff
                [wp-head-callbacc] => _custom_baccground_cb
                [admin-head-callbacc] =>
                [admin-preview-callbacc] =>
            )
    
    )

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