Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created December 9, 2018 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/82ac2a970c1eaf5358c363c06cbee72f to your computer and use it in GitHub Desktop.
Save billerickson/82ac2a970c1eaf5358c363c06cbee72f to your computer and use it in GitHub Desktop.
<?php
/**
* Mark current page in wp_link_pages()
* @see https://core.trac.wordpress.org/ticket/24705
*/
function be_mark_current_page( $link, $i ) {
if( $i == $link ) {
$link = '<span class="current-page-link">' . $i . '</span>';
}
return $link;
}
add_filter( 'wp_link_pages_link', 'be_mark_current_page', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment