get_linkobjectsbyname
Gets an array of link objects associated with category $cat_name.
Description
(array) get_linkobjectsbyname( (string) $cat_name = 'noname', (string) $orderby = 'name', (int) $limit = -1 );
= get_linkobjectsbyname( fred ); echo$link
s
$link
->link_name .Returns (array)
Parameters (3)
- 0. $cat_name — Optional. (string) =>
'noname'
- The category name to use. If no match is found uses all.
- 1. $orderby — Optional. (string) =>
'name'
- The order to output the links. E.g. id,, name., url , description, or rating. Or maybe owner. If you start the name with an underscore the order will be reversed. You can also specify rand as the order which will return links in a random order.
- 2. $limit — Optional. (int) =>
-1
- Limit to X entries. If not specified, all entries are shown.
Usage
if ( !function_exists( 'get_linkobjectsbyname' ) ) { require_once ABSPATH . WPINC . '/deprecated.php'; } // The category name to use. If no match is found uses all. $cat_name = 'noname'; $orderby = 'name'; // Limit to X entries. If not specified, all entries are shown. $limit = -1; // NOTICE! Understand what this does before running. $result = get_linkobjectsbyname($cat_name, $orderby, $limit);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/deprecated.php
- function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) {
- _deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' );
- $cat_id = -1;
- $cat = get_term_by('name', $cat_name, 'link_category');
- if ( $cat )
- $cat_id = $cat->term_id;
- return get_linkobjects($cat_id, $orderby, $limit);
- }