molongui_author_select

Molongui » Help » Molongui Authorship Docs » Shortcodes » molongui_author_select

This shortcode allows you to display a dropdown select listing (all the) authors from your blog.

Developers Only

This shortcode is intended for developers only.
It does nothing by itself, so you need to code some logic that handles user selection.

The dropdown does nothing by itself… meaning that you need to code some logic that handles user selection. You can find it useful to selectively display author information based on user selection.

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.

Example

The trivial shortcode would be:

Editor input

[molongui_author_select]

Frontend output

For your convenience as a coder, you can also modify select tag attributes:

Editor input

[molongui_author_select select_id=myId select_class=myClass]

Frontend output

				
					<select id="myId" class="myClass">
   <option value="">Select an author</option>
   <option value="user-1" data-author-id="1" data-author-type="user">Claire Williams</option>
   <option value="guest-303" data-author-id="303" data-author-type="guest">James White</option>
   <option value="user-32" data-author-id="32" data-author-type="user">John Smith</option>
   <option value="guest-307" data-author-id="307" data-author-type="guest">Nick Goldman</option>
   <option value="guest-289" data-author-id="289" data-author-type="guest">Noah Backer</option>
   <option value="guest-304" data-author-id="304" data-author-type="guest">Olivia Adams</option>
</select>
				
			

Attributes

Check out below all the available attributes this shortcode can take:

typeoptional
Type of authors to list.
Accepts “authors”, “users” or “guests”.
Defaults to authors.
Available since version 1.0.0.

orderoptional
Designates the ascending or descending order of the “orderby” parameter.
Accepts “asc” or “desc”.
Defaults to asc.
Available since version 1.0.0.

orderbyoptional
Sort retrieved authors by parameter.
Accepts “name”, “first_name”, “last_name”, “mail”, “job”, “company” or “post_count.
Defaults to name.
Available since version 1.0.0.

exclude_usersoptional
Comma separated list of registered authors to exclude from being listed.
Available since version 1.0.0.

exclude_guestsoptional
Comma separated list of guest authors to exclude from being listed.
Available since version 1.0.0.

with_postsoptional
Whether to list only those authors with at least one authored post.
Accepts “yes” or “no”.
Defaults to no.
Available since version 1.0.0.

countoptional
Maximum number of authors to list.
Accepts integer.
Defaults to all.
Available since version 1.0.0.

select_idoptional
Id for the select.
Accepts text.
Available since version 1.0.0.

select_classoptional
CSS class(es) for the select.
Accepts text.
Available since version 1.0.0.

select_attsoptional
Custom attributes to add to the select tag.
Accepts text.
Available since version 1.0.0.
Updated on February 26, 2022

Did not find a solution? We are here to help you succeed.
Open a support ticket