Refresh deprecated bookmark functions. Props filosofo. fixes #10920

git-svn-id: http://svn.automattic.com/wordpress/trunk@12525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-12-23 18:49:22 +00:00
parent 9b6bd6bf87
commit 059d7225fb
2 changed files with 34 additions and 19 deletions

View File

@ -153,6 +153,8 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
* formatted bookmarks. * formatted bookmarks.
* 'categorize' - Default is 1 (integer). Whether to show links listed by * 'categorize' - Default is 1 (integer). Whether to show links listed by
* category (default) or show links in one column. * category (default) or show links in one column.
* 'show_description' - Default is 0 (integer). Whether to show the description
* of the bookmark.
* *
* These options define how the Category name will appear before the category * These options define how the Category name will appear before the category
* links are displayed, if 'categorize' is 1. If 'categorize' is 0, then it will * links are displayed, if 'categorize' is 1. If 'categorize' is 0, then it will

View File

@ -471,23 +471,30 @@ function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />',
* Gets the links associated with the named category. * Gets the links associated with the named category.
* *
* @since 1.0.1 * @since 1.0.1
* @deprecated Use wp_get_links() * @deprecated Use wp_list_bookmarks()
* @see wp_get_links() * @see wp_list_bookmarks()
* *
* @param string $category The category to use. * @param string $category The category to use.
* @param string $args * @param string $args
* @return bool|null * @return bool|null
*/ */
function wp_get_linksbyname($category, $args = '') { function wp_get_linksbyname($category, $args = '') {
_deprecated_function(__FUNCTION__, '0.0', 'wp_get_links()'); _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()');
$cat = get_term_by('name', $category, 'link_category'); $defaults = array(
if ( !$cat ) 'after' => '<br />',
return false; 'before' => '',
$cat_id = $cat->term_id; 'categorize' => 0,
'category_after' => '',
'category_before' => '',
'category_name' => $category,
'show_description' => 1,
'title_li' => '',
);
$args = add_query_arg('category', $cat_id, $args); $r = wp_parse_args( $args, $defaults );
wp_get_links($args);
return wp_list_bookmarks($r);
} }
/** /**
@ -927,7 +934,7 @@ function permalink_single_rss($deprecated = '') {
* @return null|string * @return null|string
*/ */
function wp_get_links($args = '') { function wp_get_links($args = '') {
_deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()');
if ( strpos( $args, '=' ) === false ) { if ( strpos( $args, '=' ) === false ) {
$cat_id = $args; $cat_id = $args;
@ -935,18 +942,24 @@ function wp_get_links($args = '') {
} }
$defaults = array( $defaults = array(
'category' => -1, 'before' => '', 'after' => '<br />',
'after' => '<br />', 'between' => ' ', 'before' => '',
'show_images' => true, 'orderby' => 'name', 'between' => ' ',
'show_description' => true, 'show_rating' => false, 'categorize' => 0,
'limit' => -1, 'show_updated' => true, 'category' => '',
'echo' => true 'echo' => true,
'limit' => -1,
'orderby' => 'name',
'show_description' => true,
'show_images' => true,
'show_rating' => false,
'show_updated' => true,
'title_li' => '',
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo); return wp_list_bookmarks($r);
} }
/** /**