This shortcode allows you to display any author meta data from the current post author if no attributes are provided or the name of a given author if you provide the author ID and author type.
It can be used anywhere within WordPress where shortcodes are supported. For most users, this will primarily be within the content of a WordPress post or page or the sidebar.
Example
The trivial shortcode would be:
Editor input
[molongui_author_meta key=twitter]
That would display the current post’s author meta as text. Nothing fancy but very useful in many cases. Check below what the output would look like:
Frontend output
@colleenVance
Attributes
Check out below all the available attributes this shortcode can take:
keyrequired
Meta key name.
Accepts “first_name”, “last_name”, “phone”, “mail”, “web”, “job”, “company”, “company_link”, “post_count”, “page_count”, “{post_type}_count”, “twitter”, “facebook”… and any other social media key name.
Available since version 1.0.0.
idoptional
Author ID whose data you want to get.
Accepts integer as author ID.
Defaults to current post author ID.
Available since version 1.0.0.
typeoptional
The type of author.
Accepts Accepts “user” or “guest”.
Available since version 1.0.0.
display_errorsoptional
Whether to display a message in case of error.
Accepts Accepts “yes” or “no”.
Defaults to yes.
Available since version 1.0.0.