_s: Remove author data shim.

Immediate set up of author data in author archives was added in
WordPress 3.7, so it’s safe to remove.

See https://core.trac.wordpress.org/ticket/14408.
See a156f2cbab.
This commit is contained in:
Konstantin Obenland 2014-12-30 20:19:28 -08:00
parent 01819a8a0a
commit 2580a0a69f
1 changed files with 0 additions and 21 deletions

View File

@ -81,24 +81,3 @@ if ( version_compare( $GLOBALS['wp_version'], '4.1', '<' ) ) :
}
add_action( 'wp_head', '_s_render_title' );
endif;
/**
* Sets the authordata global when viewing an author archive.
*
* This provides backwards compatibility with
* http://core.trac.wordpress.org/changeset/25574
*
* It removes the need to call the_post() and rewind_posts() in an author
* template to print information about the author.
*
* @global WP_Query $wp_query WordPress Query object.
* @return void
*/
function _s_setup_author() {
global $wp_query;
if ( $wp_query->is_author() && isset( $wp_query->post ) ) {
$GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author );
}
}
add_action( 'wp', '_s_setup_author' );