skt_photo_session_setup_author

Sets the authordata global when viewing an author archive.

Description

skt_photo_session_setup_author(); 

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.


Usage

  1. if ( !function_exists( 'skt_photo_session_setup_author' ) ) { 
  2. require_once '/inc/extras.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = skt_photo_session_setup_author(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/extras.php  
  1. function skt_photo_session_setup_author() { 
  2. global $wp_query; 
  3.  
  4. if ( $wp_query->is_author() && isset( $wp_query->post ) ) { 
  5. $GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author );