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 ); 

$links = get_linkobjectsbyname( fred ); echo

  • . $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

    1. if ( !function_exists( 'get_linkobjectsbyname' ) ) { 
    2. require_once ABSPATH . WPINC . '/deprecated.php'; 
    3.  
    4. // The category name to use. If no match is found uses all. 
    5. $cat_name = 'noname'; 
    6. $orderby = 'name'; 
    7.  
    8. // Limit to X entries. If not specified, all entries are shown. 
    9. $limit = -1; 
    10.  
    11. // NOTICE! Understand what this does before running. 
    12. $result = get_linkobjectsbyname($cat_name, $orderby, $limit); 
    13.  

    Defined (1)

    The function is defined in the following location(s).

    /wp-includes/deprecated.php  
    1. function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) { 
    2. _deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' ); 
    3.  
    4. $cat_id = -1; 
    5. $cat = get_term_by('name', $cat_name, 'link_category'); 
    6. if ( $cat ) 
    7. $cat_id = $cat->term_id; 
    8.  
    9. return get_linkobjects($cat_id, $orderby, $limit);