Make WordPress Core

Ticket #10920: wp_get_links.deprecated.10920.diff

File wp_get_links.deprecated.10920.diff, 3.0 KB (added by filosofo, 16 years ago)
  • wp-includes/bookmark-template.php

     
    153153 *              formatted bookmarks.
    154154 * 'categorize' - Default is 1 (integer). Whether to show links listed by
    155155 *              category (default) or show links in one column.
     156 * 'show_description' - Default is 0 (integer). Whether to show the description
     157 *              of the bookmark.
    156158 *
    157159 * These options define how the Category name will appear before the category
    158160 * links are displayed, if 'categorize' is 1. If 'categorize' is 0, then it will
  • wp-includes/deprecated.php

     
    471471 * Gets the links associated with the named category.
    472472 *
    473473 * @since 1.0.1
    474  * @deprecated Use wp_get_links()
    475  * @see wp_get_links()
     474 * @deprecated Use wp_list_bookmarks()
     475 * @see wp_list_bookmarks()
    476476 *
    477477 * @param string $category The category to use.
    478478 * @param string $args
    479479 * @return bool|null
    480480 */
    481481function wp_get_linksbyname($category, $args = '') {
    482         _deprecated_function(__FUNCTION__, '0.0', 'wp_get_links()');
     482        _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()');
    483483
    484         $cat = get_term_by('name', $category, 'link_category');
    485         if ( !$cat )
    486                 return false;
    487         $cat_id = $cat->term_id;
     484        $defaults = array(
     485                'after' => '<br />',
     486                'before' => '',
     487                'categorize' => 0,
     488                'category_after' => '',
     489                'category_before' => '',
     490                'category_name' => $category,
     491                'show_description' => 1,
     492                'title_li' => '',
     493        );
     494       
     495        $r = wp_parse_args( $args, $defaults );
    488496
    489         $args = add_query_arg('category', $cat_id, $args);
    490         wp_get_links($args);
     497        return wp_list_bookmarks($r);
    491498}
    492499
    493500/**
     
    927934 * @return null|string
    928935 */
    929936function wp_get_links($args = '') {
    930         _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()');
     937        _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()');
    931938
    932939        if ( strpos( $args, '=' ) === false ) {
    933940                $cat_id = $args;
     
    935942        }
    936943
    937944        $defaults = array(
    938                 'category' => -1, 'before' => '',
    939                 'after' => '<br />', 'between' => ' ',
    940                 'show_images' => true, 'orderby' => 'name',
    941                 'show_description' => true, 'show_rating' => false,
    942                 'limit' => -1, 'show_updated' => true,
    943                 'echo' => true
     945                'after' => '<br />',
     946                'before' => '',
     947                'between' => ' ',
     948                'categorize' => 0,
     949                'category' => '',
     950                'echo' => true,
     951                'limit' => -1,
     952                'orderby' => 'name',
     953                'show_description' => true,
     954                'show_images' => true,
     955                'show_rating' => false,
     956                'show_updated' => true,
     957                'title_li' => '',
    944958        );
    945959
    946960        $r = wp_parse_args( $args, $defaults );
    947         extract( $r, EXTR_SKIP );
    948 
    949         return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo);
     961       
     962        return wp_list_bookmarks($r);
    950963}
    951964
    952965/**