Skip to content
Chris Reynolds edited this page Jan 20, 2015 · 4 revisions

Book Review Library Template Tags

This is a quick reference for all the existing template tags and functions that can be used in themes and plugins building on Book Review Library.

Table of contents

Get Review Author

returns a formatted list of review authors (comma-separated by default)

  • @since 1.0.0
  • @param $before string string to display before the author name
  • @param $after string string to display after the author name (comma by default)
  • @param $forced boolean by default, if the item is the last in the list, the $after variable doesn't render. If $forced is set to TRUE it will bypass this and render it anyway (e.g. if passing $before = '<li>' / $after = '</li>')
  • @return $review_author_list sanitized string of the results

get_review_author($before = null, $after = ', ', $forced = false)

Examples

Get Genres

returns a formatted list of genres (comma-separated by default) with links to each

  • @since 1.0.0
  • @param $before string string to display before the genre
  • @param $after string string to display after the genre (comma by default)
  • @param $forced boolean by default, if the item is the last in the list, the $after variable doesn't render. If $forced is set to TRUE it will bypass this and render it anyway (e.g. if passing $before = '<li>' / $after = '</li>')
  • @return $genre_list sanitized string of the results

get_genres($before = null, $after = ', ', $forced = false)

Examples

Get Book Author

returns a formatted list of book authors (comma-separated by default) with links to each

  • @since 1.0.0
  • @param $before string string to display before the author name
  • @param $after string string to display after the author name (comma by default)
  • @param $forced boolean by default, if the item is the last in the list, the $after variable doesn't render. If $forced is set to TRUE it will bypass this and render it anyway (e.g. if passing $before = '<li>' / $after = '</li>')
  • @return $book_author_list sanitized string of the results

get_book_author($before = null, $after = ', ', $forced = false)

Examples

Get reading level

returns a formatted list of reading levels (comma-separated by default) with links to each

  • @since 1.0.0
  • @param $before string string to display before the reading level
  • @param $after string string to display after the reading level (comma by default)
  • @param $forced boolean by default, if the item is the last in the list, the $after variable doesn't render. If $forced is set to TRUE it will bypass this and render it anyway (e.g. if passing $before = '<li>' / $after = '</li>')
  • @return $reading_level_list sanitized string of the results

get_reading_level($before = null, $after = ', ', $forced = false)

Examples

Get subjects

returns a formatted list of subjects (comma-separated by default) with links to each

  • @since 1.0.0
  • @param $before string string to display before the subject
  • @param $after string string to display after the subject (comma by default)
  • @param $forced boolean by default, if the item is the last in the list, the $after variable doesn't render. If $forced is set to TRUE it will bypass this and render it anyway (e.g. if passing $before = '<li>' / $after = '</li>')
  • @return $subject_list sanitized string of the results

get_subjects($before = null, $after = ', ', $forced = false)

Examples

Get rating stars

returns a genericon star icon for each star value in the rating taxonomy

  • @since 1.0.0
  • @return $rating_out sanitized string of the results

get_rating_stars()

Examples

Get rating

returns a comma-separated list of ratings (if more than one rating is applied to a review, for some reason)

  • @since 1.0.0
  • @return $stars sanitized string of the results

get_rating($before = null, $after = ', ', $forced = false)

Examples

Get illustrator

returns a formatted list of illustrators (comma-separated by default) with links to each

  • @since 1.0.0
  • @param $before string string to display before the illustrator name
  • @param $after string string to display after the illustrator name (comma by default)
  • @param $forced boolean by default, if the item is the last in the list, the $after variable doesn't render. If $forced is set to TRUE it will bypass this and render it anyway (e.g. if passing $before = '<li>' / $after = '</li>')
  • @return $illustrator_list sanitized string of the results

get_illustrator($before = null, $after = ', ', $forced = false)

Examples

Get awards

returns a formatted list of awards (comma-separated by default) with links to each

  • @since 1.0.0
  • @param $before string string to display before the award name
  • @param $after string string to display after the award name (comma by default)
  • @param $forced boolean by default, if the item is the last in the list, the $after variable doesn't render. If $forced is set to TRUE it will bypass this and render it anyway (e.g. if passing $before = '<li>' / $after = '</li>')
  • @return $award_list sanitized string of the results

get_awards($before = null, $after = ', ', $forced = false)

Examples

Get series

returns a formatted list of series (comma-separated by default) with links to each

  • @since 1.0.0
  • @param $before string string to display before the series name
  • @param $after string string to display after the series name (comma by default)
  • @param $forced boolean by default, if the item is the last in the list, the $after variable doesn't render. If $forced is set to TRUE it will bypass this and render it anyway (e.g. if passing $before = '<li>' / $after = '</li>')
  • @return $series_list sanitized string of the results

get_book_series($before = null, $after = ', ', $forced = false)

Examples

Is Option Enabled

Check if a particular option is enabled, wrapper for Book_Reviews::is_option_enabled()

  • @since 1.5.0
  • @param string The option name to check
  • @return bool True of the setting is enabled, false if it isn't or no option was passed

book_reviews_is_option_enabled( $option_name = '' )