Binders: author

The {{author…}} binder will allow you to access the post author information in a quick and easy way. All what yo have to do is to include the {{author…}} binder and provide the post “user_id” or the “post_id” and voila! The author information will be bound to your page and you can access it from a variable that you can defined.

/**
 * Binds post author data to a template if user_id or post_id were provided.
 *
 * @param {array} $params 
 *                $params['post_id'] 
 *                $params['user_id'] 
 *
 * @return {object}
 * 
 * $response
 * $response['success'] {boolean}
 * $response['data']['ID']
 * $response['data']['user_login']
 * $response['data']['user_nicename']
 * $response['data']['user_email']
 * $response['data']['user_url']
 * $response['data']['display_name']
 * $response['data']['first_name']
 * $response['data']['last_name']
 * $response['data']['nickname']
 * $response['data']['description']
 * $response['data']['aim']
 * $response['data']['yim']
 * $response['data']['jabber']
 * $response['data']['facebook_avatar_thumb']
 * $response['data']['facebook_avatar_full']
 * $response['data']['last_login'] # e.g. 2015-09-30 02:07:56
 * $response['data']['billing_country']
 * ...
 * $response['data']['billing_email']
 * $response['data']['fullname']
 * $response['data']['website']
 * $response['data']['permalink']
 * 
 * @example
 * 
 * Example #1:
 * 
 * {{author user_id="{{$post.post_author}}" assign_to="author"}}
 * 
 * <!-- OR -->
 *
 * {{author post_id="{$post.ID}" assign_to="author"}}
 *
 * <p>by: <strong>{{$author_data.fullname}}</strong><br/>
 * <p>email: <strong>{{$author_data.user_email}}</strong><br/>
 *
 * {{dump var="author_data"}}
 *
 */

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *