get_bookmarks

SummerySummery

Retrieves the list of bookmarks

Syntax

get_bookmarks( string|array $args = '' )

DescriptionDescription

Attempts to retrieve from the cache first based on MD5 hash of arguments. If that fails, then the query will be built from the arguments and executed. The results will be stored to the cache.

ParametersParameters

$args

(string|array) (Optional) String or array of arguments to retrieve bookmarks.

  • 'orderby'
    (string) How to order the links by. Accepts 'id', 'link_id', 'name', 'link_name', 'url', 'link_url', 'visible', 'link_visible', 'rating', 'link_rating', 'owner', 'link_owner', 'updated', 'link_updated', 'notes', 'link_notes', 'description', 'link_description', 'length' and 'rand'. When $orderby is 'length', orders by the character length of 'link_name'. Default 'name'.
  • 'order'
    (string) Whether to order bookmarks in ascending or descending order. Accepts 'ASC' (ascending) or 'DESC' (descending). Default 'ASC'.
  • 'limit'
    (int) Amount of bookmarks to display. Accepts any positive number or -1 for all. Default -1.
  • 'category'
    (string) Comma-separated list of category ids to include links from.
  • 'category_name'
    (string) Category to retrieve links for by name.
  • 'hide_invisible'
    (int|bool) Whether to show or hide links marked as 'invisible'. Accepts 1|true or 0|false. Default 1|true.
  • 'show_updated'
    (int|bool) Whether to display the time the bookmark was last updated. Accepts 1|true or 0|false. Default 0|false.
  • 'include'
    (string) Comma-separated list of bookmark IDs to include.
  • 'exclude'
    (string) Comma-separated list of bookmark IDs to exclude.
  • 'search'
    (string) Search terms. Will be SQL-formatted with wildcards before and after and searched in 'link_url', 'link_name' and 'link_description'.

Default value: ''

ReturnReturn

(object[]) List of bookmark row objects.

SourceSource

File: wp-includes/bookmark.php


			

ChangelogChangelog

Changelog
Version Description
2.1.0 Introduced.
Scroll to Top