Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Created July 9, 2016 19:51
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 hellofromtonya/485043dbde384d52933b9e13d29b8156 to your computer and use it in GitHub Desktop.
Save hellofromtonya/485043dbde384d52933b9e13d29b8156 to your computer and use it in GitHub Desktop.
Example of how to customize unfiltered string content using PHP instruction str_replace
add_filter( 'wp_link_pages_args', 'change_link_pages_args' );
/**
* Change the Link Pages Arguments - a demonstration of how to change
* "unfiltered" (meaning not passed through apply_filters())
* string data using PHP instruction str_replace().
*
* @since 1.0.0
*
* @param array $args
*
* @return array
*/
function change_link_pages_args( array $args ) {
$args['before'] = str_replace( 'Pages:', 'Read More:', $args['before'] );
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment