-
Notifications
You must be signed in to change notification settings - Fork 7
Function Reference
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.
get_review_author
get_genres
get_book_author
get_reading_level
get_subjects
get_rating_stars
get_rating
get_illustrator
get_awards
get_book_series
book_reviews_is_option_enabled
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 toTRUE
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)
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 toTRUE
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)
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 toTRUE
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)
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 toTRUE
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)
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 toTRUE
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)
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()
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)
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 toTRUE
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)
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 toTRUE
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)
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 toTRUE
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)
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 = '' )