Plugin / Linkify Authors

Scott Reilly

Description

Description

The plugin provides a widget called “Linkify Authors” as well as a template tag, c2c_linkify_authors(), which allow you to easily specify authors to list and how to list them. Authors are specified by either ID or slug. See other parts of the documentation for example usage and capabilities.

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

Template Tags

The plugin provides one template tag for use in your theme templates, functions.php, or plugins.

Functions

  • <?php c2c_linkify_authors( $authors, $before = '', $after = '', $between = ', ', $before_last = '', $none = '' ) ?>
    Displays links to each of any number of authors specified via author IDs/slugs

Arguments

  • $authors
    A single author ID/slug, or multiple author IDs/slugs defined via an array, or multiple authors IDs/slugs defined via a comma-separated and/or space-separated string

  • $before
    (optional) To appear before the entire author listing (if authors exist or if ‘none’ setting is specified)

  • $after
    (optional) To appear after the entire author listing (if authors exist or if ‘none’ setting is specified)

  • $between
    (optional) To appear between authors

  • $before_last
    (optional) To appear between the second-to-last and last element, if not specified, ‘between’ value is used

  • $none
    (optional) To appear when no posts have been found. If blank, then the entire function doesn’t display anything

Examples

  • These are all valid calls:

  • <?php c2c_linkify_authors("3 9"); ?>

Outputs something like:

<a href="http://yourblog.com/archives/author/admin">Scott</a>, <a href="http://yourblog.com/archives/author/billm">Bill</a>
  • Assume that you have a custom field with a key of “Related Authors” that happens to have a value of “3, 9” defined (and you’re in-the-loop).

Outputs something like:

Related authors: <a href="http://yourblog.com/archives/author/admin">Scott</a>, <a href="http://yourblog.com/archives/author/billm">Bill</a>
  • <ul><?php c2c_linkify_authors("3, 9", "<li>", "</li>", "</li><li>"); ?></ul>

Outputs something like:

<ul><li><a href="http://yourblog.com/archives/author/admin">Scott</a></li>
<li><a href="http://yourblog.com/archives/author/billm">Bill</a></li></ul>
  • <?php c2c_linkify_authors(""); // Assume you passed an empty string as the first value ?>

Displays nothing.

  • <?php c2c_linkify_authors("", "", "", "", "", "No related authors."); // Assume you passed an empty string as the first value ?>

Outputs:

No related authors.<h3>Hooks</h3>

The plugin exposes one action for hooking.

c2c_linkify_authors (action)

The ‘c2c_linkify_authors’ hook allows you to use an alternative approach to safely invoke c2c_linkify_authors() in such a way that if the plugin were to be deactivated or deleted, then your calls to the function won’t cause errors in your site.

Arguments:

  • same as for c2c_linkify_authors()

Example:

Instead of:

<?php c2c_linkify_authors( '19, 28', 'Authors: ' ); ?>

Do:

<?php do_action( 'c2c_linkify_authors', '19, 28', 'Authors: ' ); ?>

Ratings

0
0 reviews

Rating breakdown

Details Information

Version

2.2.2

First Released

28 May, 2009

Total Downloads

3,702

Wordpress Version

3.3 or higher

Tested up to:

5.1.3

Require PHP Version:

-

Tags

Contributors

Languages

The plugin hasn't been transalated in any language other than English.

DIRECTORY DISCLAIMER

The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.