WordPress V5.0+Template Tag Reference Guide as of Version 5.2
Presented by DBS > Interactive Development :
Bookmark Tags
WP List Bookmarkswp_nav_menu();
Displays bookmarks found in the Administration > Links panel.This Template Tag allows the user to control how the bookmarks are sorted and displayed.
$args = array( | ||||
'orderby' | => | 'name', | ||
'order' | => | 'ASC', | ||
'limit' | => | -1, | ||
'category' | => | ' ', | ||
'exclude_category' | => | ' ', | ||
'category_name' | => | ' ', | ||
'hide_invisible' | => | 1, | ||
'show_updated' | => | 0, | ||
'echo' | => | 1, | ||
'categorize' | => | 1, | ||
'title_li' | => | __('Bookmarks'), | ||
'title_before' | => | '<h2>', | ||
'title_after' | => | '</h2>', | ||
'category_orderby' | => | 'name', | ||
'category_order' | => | 'ASC', | ||
'class' | => | 'linkcat', | ||
'category_before' | => | '<li id=%id class=%class>', | ||
'category_after' | => | '</li>' | ||
); |
<?php wp_list_bookmarks( $args ); ?>
categorize
(boolean) Bookmarks should be shown within their assigned Categories or not.
1 (True) - Default
0 (False)
category
(string)
Comma separated list of numeric Category IDs to be displayed. If none is specified, all Categories with bookmarks are shown. Defaults to '' (all Categories).
exclude_category
(string)
Comma separated list of numeric Category IDs to be excluded from display. Defaults to '' (no categories excluded).
category_name
(string)
The name of a Category whose bookmarks will be displayed. If none is specified, all Categories with bookmarks are shown. Defaults to '' (all Categories).
category_before
(String)
ext to place before each category. Defaults to '<li id="[category id]" class="linkcat">' .
category_after
(String)
Text to place after each category. Defaults to '</li>'
class
(string)
The class each category li will have on it. Defaults to 'linkcat' .
category_orderby
(string)
'name' - Default
'id'
'slug'
'count'
'term_group' (not used yet)
category_order
(string)
Sort order, ascending or descending for the category_orderby parameter. Valid values:
ASC - Default
DESC
title_li
Default: none
(string) Text for the heading of the links list. Defaults to '__('Bookmarks')', which displays "Bookmarks" (the __('') is used for localization purposes). Only used when 'categorize' are set to 0 [false] (else the category names will be used instead). If 'title_li' is set to null (0) value, no heading is displayed, and the list will not be wrapped with <ul>, </ul> tags (be sure to pass the 'categorize' option to 0 [false] to this option takes effect).
title_before
(string)
Text to place before each Category description if 'categorize' is 1 [true], or text defined in "title_li" if 'categorize' is 0 [false]. Defaults to '<h2>'.
title_after
(String)
Text to place after each Category description if 'categorize' is 1 [true], or text defined in "title_li" if 'categorize' is 0 [false]. Defaults to '</h2>'.
show_private
(boolean)
Should a Category be displayed even if the Category is considered private. Ignore the admin setting and show private Categories (TRUE) or do NOT show private Categories (FALSE).
(string)
String • Default: none
Comma separated list of numeric bookmark IDs to include in the output. For example, 'include=1,3,6' means to return or echo bookmark IDs 1, 3, and 6. If the include string is used, the category, category_name, and exclude parameters are ignored. Defaults to '' (all Bookmarks).
exclude
(String)
Comma separated list of numeric bookmark IDs to exclude. For example, 'exclude=4,12' means that bookmark IDs 4 and 12 will NOT be returned or echoed. Defaults to '' (exclude nothing).
orderby
(String)
Value to sort bookmarks on. This can be a COMMA separated list of values. Defaults to 'name' unless you pass the value of '' (empty), in which case it sets to 'id'. Valid options:
order
(String)
Bookmarks display sorting order, ascending or descending as defined in the 'orderby' parameter. Valid values:
ASC - Default
DESC
limit
(integer)
Maximum number of bookmarks to display. Default is -1 (all bookmarks).
before
(string)
Text to place before each bookmark. Defaults to '<li>'.
after
(string)
Text to place after each bookmark. Defaults to '</li>'.
link_before
(string)
Text to place before the text of each bookmark, inside the hyperlink code.
link_after
(string)
Text to place after the text of each bookmark. There is no set default
between
(string)
Text to place between each bookmark/image and its description. Defaults to '\n' (newline).
show_description
(boolean)
Should the description be displayed (TRUE) or not (FALSE). Valid when show_images is FALSE, or an image is not defined.
1 (True)
0 (False) - Default
show_name
(boolean)
Displays the text of a link when (TRUE). Works when show_images is TRUE.
1 (True)
0 (False) - Default
show_rating
(boolean)
Should rating stars/characters be displayed (TRUE) or not (FALSE).
1 (True)
0 (False) - Default
show_updated
(boolean)
Should the last updated timestamp be displayed (TRUE) or not (FALSE). Note that link_updated does not track local modifications. It tracks when whatever the link points to is updated via remote requests to pingomatic.
1 (True)
0 (False) - Default
hide_invisible
(boolean)
Should bookmark be displayed even if it's Visible setting is No. Abides by admin setting (TRUE) or does no abide by admin setting (FALSE).
1 (True) - Default
0 (False)
Get Bookmark get_bookmark();
Retrieve Bookmark data based on bookmark link ID.
<?php get_bookmark( $bookmark, $output, $filter ) ?>
$bookmark
I(integer|object) (required)
Bookmark link ID or Bookmark object.
Default: None
$output
(string) (optional)
Either OBJECT, ARRAY_N, or ARRAY_A constant
Default: OBJECT
$filter
(string) (optional)
default is 'raw'.
Default: 'raw'
Get Bookmark Fieldget_bookmark_field();
Retrieve single bookmark data item or field.
<?php get_bookmark_field( $field, $bookmark, $context ); ?>
$field
(string) (required)
The name of the data field to return .
Default: None
$bookmark
(int) (required)
The bookmark ID to get field
Default: NONE
$context
(string) (optional) Optional
The context of how the field will be used.
Default: display
Get Bookmarksget_bookmarks();
This function returns an array of bookmarks found in the Administration > Links > Edit panel. This Template Tag allows the user to retrieve the bookmark information directly.
<?php get_bookmarks( $args ); ?>
$args = array( | ||||
'orderby' | => | 'name', | ||
'order' | => | 'ASC', | ||
'limit' | => | -1, | ||
'category' | => | ' ', | ||
'category_name' | => | ' ', | ||
'hide_invisible' | => | 1, | ||
'show_updated' | => | 0, | ||
'include' | => | ' ', | ||
'exclude' | => | ' ', | ||
'search' | => | '' | ||
); |
orderby
(string)
string) Value to sort bookmarks on. Defaults to 'name'. Valid options:
'link_id' - Before WordPress 3.2: 'id'
'url'
'name' - Default
'owner' - User who added bookmark through bookmarks Manager.
'rating'
'visible'
'length' - The length of the bookmark name, shortest to longest.
'rand' - Display bookmarks in random order.
order
(string)Sort order, ascending or descending for the orderby parameter. Valid values:
ASC - Default
DESC
limit
(integer)
Maximum number of bookmarks to display. Defaults to -1 (all bookmarks).
category
(String)
Comma separated list of bookmark category ID's.
category_name
(String)
Category name of a category of bookmarks to retrieve. Overrides category parameter.
hide_invisible
(boolean)
TRUE causes only bookmarks with link_visible set to 'Y' to be retrieved.
1 (True) - Default
0 (False)
show_updated
(boolean)
TRUE causes an extra column called "link_category_f" to be inserted into the results, which contains the same value as "link_updated", but in a unix timestamp format. Handy for using PHP date functions on this data.
1 (True)
0 (False) - Default
include
(string)
Comma separated list of numeric bookmark IDs to include in the output. For example, 'include=1,3,6' means to return or echo bookmark IDs 1, 3, and 6. If the include string is used, the category, category_name, and exclude parameters are ignored. Defaults to '' (all Bookmarks).
exclude
(string)
Comma separated list of numeric bookmark IDs to exclude. For example, 'exclude=4,12' means that bookmark IDs 4 and 12 will NOT be returned or echoed. Defaults to '' (exclude nothing).
search
(string)
Searches link_url, link_name or link_description like the search string. Defaults to ''.