Overview

o2 Author Extended enriches the native WordPress author with a guest author, multiple co-authors, and automatic display rules. The plugin adds a simple meta box in the admin, stores metadata, and exposes a shortcode to replace the native author output in third-party themes.

  • Add a guest author (name + URL).
  • Select co-authors from the author list.
  • Clear rules for combining guest author, native author, and co-authors.
  • Ready-to-use shortcode for external themes.
  • Clean and secure output (escaping).

Quick setup

  1. Install and activate the o2 Author Extended plugin.
  2. Open a post and fill in the Authors meta box.
  3. Add the [o2_authors] shortcode in your content or template.
  4. Verify the front-end output.

Admin interface

The meta box is split into two blocks for fast scanning and explicit field activation.

Guest Author block

  • Guest Author (checkbox): enables or disables the block.
  • Guest author name: name shown for the guest author.
  • Guest author URL: link associated with the guest author.
  • Also display the native post author: allows the native author to be shown alongside the guest.

Co-Authors block

  • Co-Authors (checkbox): enables or disables the block.
  • Co-authors (multi-select): select multiple existing authors.

Activation rules

  • If Guest Author is enabled, the guest fields are available.
  • Co-authors are allowed only if the guest author also shows the native author.
  • If a guest author is used alone (without the native author), the co-authors field is disabled.

Stored fields and metadata

The plugin stores the following metadata on posts.

Meta Type Purpose
guest_author_enabled string (1/0) Enable the Guest Author block.
guest_author_name string Guest author display name.
guest_author_url string Guest author link URL.
guest_author_displaying string (1) Show the native author alongside the guest.
co_authors_enabled string (1/0) Enable the Co-Authors block.
co_authors array (IDs) List of co-author IDs.

Rendering logic

The output assembles authors in a consistent editorial order and uses the and separator for the final join.

Main use cases

  • Guest only (without native author): By [GUEST]
  • Guest + native author: By [GUEST] and [NATIVE]
  • Native author + 1 co-author: By [NATIVE] and [CO-AUTHOR]
  • Native author + 2 co-authors: By [NATIVE], [CO-AUTHOR 1] and [CO-AUTHOR 2]
  • Guest + native author + co-author: By [GUEST], [NATIVE] and [CO-AUTHOR]

Additional rules

  • Co-authors are ignored if the guest is enabled but the native author is not displayed.
  • If no co-authors are defined, the native author is shown alone.
  • The prefix can be customized via argument or shortcode.

Shortcode for third-party themes

The shortcode replaces the native author output in any theme.

Basic shortcode

[o2_authors]

Available attributes

Attribute Example Purpose
wrap_class document-author CSS classes for the wrapper.
wrap_id document-author ID for the wrapper.
prefix By Prefix before the author list.
post_id 123 Force a specific post (useful outside the loop).

Integration examples

[o2_authors wrap_class="document-author custom-class" prefix="By "]
[o2_authors post_id="123"]
<?php echo do_shortcode( '[o2_authors]' ); ?>

PHP functions

The plugin exposes the following functions for templates.

o2_the_authors()

<?php
o2_the_authors(
	array(
		'wrap_class' => 'document-author',
		'wrap_id'    => 'document-author',
		'prefix'     => __( 'By ', 'o2' ),
		'post_id'    => 0,
	)
);
?>

o2_the_author()

Outputs the native “By [AUTHOR]” label with a profile link. Use this if you want the simple version.

Customization and styles

The plugin loads a front-end CSS file for the module: plugins/o2-author-extended/assets/css/front-authors.css. You can override these styles in your theme or dequeue the style handle o2-author-extended-front if you want full control.

  • .document-author: main wrapper.
  • .guest-author: guest author.
  • .co-author: co-authors.
  • .post-author: native author link.

For third-party themes, make sure the wrapper styling matches your design system.

Accessibility and security

  • HTML output is escaped to prevent injections.
  • URLs are filtered with esc_url and text with esc_html.
  • Simple structure that remains readable for screen readers.

Compatibility

  • Compatible with classic and headless WordPress themes.
  • Works inside the loop or via post_id outside the loop.
  • Shortcode usable in builders or content editors.

FAQ

Can I use only the guest author?

Yes. Enable Guest Author, enter a name, and disable the native author display option.

Can I add co-authors if the guest author is alone?

No. Co-authors are available only when the native author is also displayed.

Does the shortcode work outside posts?

Yes, use post_id to target a specific post.

Launch checklist

  • Plugin activated.
  • Meta box filled in on posts.
  • Shortcode or function integrated in the theme.
  • Styles verified.
  • Scotty
    administrator
    replied ago:

    Example of rendering:

    If only the guest author is set and the option “Also display the native author” is disabled:
    - By [GUEST AUTHOR]

    If the guest author is set and the option “Also display the native author” is enabled:
    - By [GUEST AUTHOR] and [NATIVE AUTHOR]

    If only one or more co-authors are selected:
    - By [NATIVE AUTHOR] and [CO-AUTHOR]
    - By [NATIVE AUTHOR], [CO-AUTHOR 1] and [CO-AUTHOR 2]
    - By [NATIVE AUTHOR], [CO-AUTHOR 1], [CO-AUTHOR 2] and [CO-AUTHOR 3]

    If the guest author is set, it will only be possible to add co-authors if the option “Also display the native author” is enabled:
    - By [GUEST AUTHOR], [NATIVE AUTHOR] and [CO-AUTHOR]
    - By [GUEST AUTHOR], [NATIVE AUTHOR], [CO-AUTHOR 1] and [CO-AUTHOR 2]

    • Scotty
      administrator
      replied ago:

      Merci