Author Meta Box

On all articles (posts) and author archives, we have a nice meta box to showcase information about the author.

Author Meta Output

This metabox shows the following components.

Author Avatar

As used by WordPress itself, the gravatar of the author is shown with a size of 96X96px.

Author Bio

This is the Biographical Info filled by the author.

Social Links

By default only the website (or the author-url) of the author is shown (if not left empty).

Author Meta

If you have installed the WordPress SEO plugin and authors have filled in their social networking links, then facebook, twitter and google plus is also show.

However, there is a way to extend the number of buttons and links. The code sample below shows how.

/**
 * Add extra buttons to the author meta box
 * @param  array $buttons Array of buttons
 * @return array          Modified array
 */
function my_author_extra_buttons( $buttons ) {
	// The extension below will search the author meta
	// for a key "linkedin".
	// This is same as the key to the array itself and you will need to have some plugin
	// or your functions to let the authors edit and/or put values to this key.
	// Otherwise it will not just work out of the box.
	$buttons['linkedin'] = array(
		// The title is shown as tooltip
		'title' => 'Linked In',
		// A valid icon
		// @see https://wpquark.com/kb/wp-knowledge-base-theme/kb-components/available-glyphicons-icomoon-icons/
		'icon' => 'ipt-icon-linkedin',
	);
	return $buttons;
}
add_filter( 'ipt_kb_author_meta_buttons', 'my_author_extra_buttons' );

Do note, that the code above is just for “showing” custom author meta. It will not add functionality to edit/add them from author profile. For that, you might want to use some plugin like Extra User Details.

For more extensibility you can completely override the function ipt_kb_author_meta as it is pluggable.

Swashata has written 257 articles

Hi there, I am the Lead Developer at WPQuark.com. I love to create something beautiful for WordPress and here I write about how to use them. When I am not working, usually I am doing a number of other creative things ;).