Skip to content

Instantly share code, notes, and snippets.

@2ndkauboy
Last active August 18, 2018 15:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save 2ndkauboy/7136933 to your computer and use it in GitHub Desktop.
Add target="_blank" to all URLs in the post author bio
<?php
/*
Plugin Name: Author Bio Target Blank
Plugin URI: https://gist.github.com/2ndkauboy/7136933
Description: Add target="_blank" to all URLs in the post author bio
Version: 0.1
Author: Bernhard Kau
Author URI: http://kau-boys.de
*/
function get_the_author_description_add_target_blank( $content ) {
return str_replace( '<a', '<a target="_blank"', $content );
}
add_filter( 'get_the_author_description', 'get_the_author_description_add_target_blank' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment