get_linksbyname

Gets the links associated with category $cat_name.

Description

get_linksbyname( (string) $cat_name = 'noname', (string) $before = '', $after = '<br />', (string) $between = ' ', (constant) $show_images = true, (string) $orderby = 'id', (constant) $show_description = true, (constant) $show_rating = false, (int) $limit = -1, (int) $show_updated = 0 ); 

Parameters (10)

0. $cat_name — Optional. (string) => 'noname'
The category name to use. If no match is found uses all.
1. $before — Optional. (string) => ''
The html to output before the link.
2. $after — Optional. (string) => '
'
The html to output after the link.
3. $between — Optional. (string) => ' '
The html to output between the link/image and its description. Not used if no image or $show_images is true.
4. $show_images — Optional. (constant) => true
Whether to show images (if defined).
5. $orderby — Optional. (string) => 'id'
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.
6. $show_description — Optional. (constant) => true
Whether to show the description if show_images=false/not defined.
7. $show_rating — Optional. (constant) => false
Show rating stars/chars.
8. $limit — Optional. (int) => -1
Limit to X entries. If not specified, all entries are shown.
9. $show_updated — Optional. (int)
Whether to show last updated timestamp

Usage

  1. if ( !function_exists( 'get_linksbyname' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // Optional. The category name to use. If no match is found uses all. 
  5. $cat_name = 'noname'; 
  6.  
  7. // Optional. The html to output before the link. 
  8. $before = ''; 
  9.  
  10. // Optional. The html to output after the link. 
  11. $after = '
    '; 
  12.  
  13. // Optional. The html to output between the link/image and its description. Not used if no image or $show_images is true. 
  14. $between = ' '; 
  15.  
  16. // Optional. Whether to show images (if defined). 
  17. $show_images = true; 
  18. $orderby = 'id'; 
  19.  
  20. // Optional. Whether to show the description if show_images=false/not defined. 
  21. $show_description = true; 
  22.  
  23. // Optional. Show rating stars/chars. 
  24. $show_rating = false; 
  25.  
  26. // Optional. Limit to X entries. If not specified, all entries are shown. 
  27. $limit = -1; 
  28.  
  29. // Optional. Whether to show last updated timestamp 
  30. $show_updated = -1; 
  31.  
  32. // NOTICE! Understand what this does before running. 
  33. $result = get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated); 
  34.  

Defined (1)

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

/wp-includes/deprecated.php  
  1. function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id',  
  2. $show_description = true, $show_rating = false,  
  3. $limit = -1, $show_updated = 0) { 
  4. _deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmarks()' ); 
  5.  
  6. $cat_id = -1; 
  7. $cat = get_term_by('name', $cat_name, 'link_category'); 
  8. if ( $cat ) 
  9. $cat_id = $cat->term_id; 
  10.  
  11. get_links($cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated);