Skip to content

Instantly share code, notes, and snippets.

@dkd903
Last active November 11, 2017 06:08
Show Gist options
  • Save dkd903/b31a920fbc7d4eec343db1358313613d to your computer and use it in GitHub Desktop.
Save dkd903/b31a920fbc7d4eec343db1358313613d to your computer and use it in GitHub Desktop.
Add target=_blank to WordPress Author Profile Bio / Description in category: http://digitizor.com/add-target-blank-author-wp/
// http://digitizor.com/add-target-blank-author-wp/
add_filter( 'get_the_author_description', 'amtf_target_blank_author_desc' );
/**
* Add target _blank to links in author description
* Drop-in fix (workaround) for: https://core.trac.wordpress.org/ticket/12056
*/
function amtf_target_blank_author_desc( $desc ) {
return str_replace( '<a', '<a target="_blank" ', $desc );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment