Stop PHP/JavaScript inserting the skip link
-
the_block_template_skip_link() in wp-includes/block-template.php inserts the skip link. I want to stop the insertion.
In functions.php, I’ve tried the following to no avail:
// Attempt 1 remove_action( 'wp_body_open', 'gutenberg_the_skip_link' ); // Attempt 2 remove_action( 'wp_body_open', 'the_block_template_skip_link' ); // Attempt 3 add_filter( 'the_block_template_skip_link', '__return_false' ); // Attempt 4 remove_action( 'init', 'the_block_template_skip_link' );I understand why the skip link is important. I’m not deleting it; I’m replacing it because I need to wrap it in a div and change the link text to title case:
add_action( 'wp_body_open', 'custom_skip_link' ); function custom_skip_link() { echo ' <div class="skip-link-container"> <a class="skip-link screen-reader-text" href="#content">Skip to Content</a> </div> '; }I understand I can remove the skip link using jQuery but I’d prefer to stop the insertion using PHP.
To clarify, I’d also like to stop the insertion of the corresponding CSS.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Stop PHP/JavaScript inserting the skip link’ is closed to new replies.