wp_enqueue_block_template_skip_link()WP 6.4.0

Enqueues the skip-link styles.

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Returns

null. Nothing (null).

Usage

wp_enqueue_block_template_skip_link();

Notes

  • Global. String. $_wp_current_template_content

Changelog

Since 6.4.0 Introduced.
Since 7.0.0 A script is no longer printed in favor of being added via _block_template_add_skip_link().

wp_enqueue_block_template_skip_link() code WP 7.0

function wp_enqueue_block_template_skip_link() {
	global $_wp_current_template_content;

	// Back-compat for plugins that disable functionality by unhooking this action.
	if ( ! has_action( 'wp_footer', 'the_block_template_skip_link' ) ) {
		return;
	}
	remove_action( 'wp_footer', 'the_block_template_skip_link' );

	// Early exit if not a block theme.
	if ( ! current_theme_supports( 'block-templates' ) ) {
		return;
	}

	// Early exit if not a block template.
	if ( ! $_wp_current_template_content ) {
		return;
	}

	wp_enqueue_style( 'wp-block-template-skip-link' );
}