Make WordPress Core

Changeset 12525


Ignore:
Timestamp:
12/23/2009 06:49:22 PM (14 years ago)
Author:
ryan
Message:

Refresh deprecated bookmark functions. Props filosofo. fixes #10920

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/bookmark-template.php

    r11838 r12525  
    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
  • trunk/wp-includes/deprecated.php

    r12515 r12525  
    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.
     
    480480 */
    481481function wp_get_linksbyname($category, $args = '') {
    482     _deprecated_function(__FUNCTION__, '0.0', 'wp_get_links()');
    483 
    484     $cat = get_term_by('name', $category, 'link_category');
    485     if ( !$cat )
    486         return false;
    487     $cat_id = $cat->term_id;
    488 
    489     $args = add_query_arg('category', $cat_id, $args);
    490     wp_get_links($args);
     482    _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()');
     483
     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 );
     496
     497    return wp_list_bookmarks($r);
    491498}
    492499
     
    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 ) {
     
    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
Note: See TracChangeset for help on using the changeset viewer.