diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-06-21 16:41:02 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-06-21 16:41:02 +0000 |
commit | a5fe68e002632c190ffbd85167671ed4d4961135 (patch) | |
tree | ae57f94603111507c50cb3c212a03bedf8f7dc5a /wp-includes/bookmark-template.php | |
parent | 4e38776b5b68c61a4593a84340f4654200f7568e (diff) | |
download | wordpress-mu-a5fe68e002632c190ffbd85167671ed4d4961135.tar.gz wordpress-mu-a5fe68e002632c190ffbd85167671ed4d4961135.tar.xz wordpress-mu-a5fe68e002632c190ffbd85167671ed4d4961135.zip |
WP Merge to WP 2.2.1
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1005 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/bookmark-template.php')
-rw-r--r-- | wp-includes/bookmark-template.php | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/wp-includes/bookmark-template.php b/wp-includes/bookmark-template.php index 2a06cf2..79bf8a3 100644 --- a/wp-includes/bookmark-template.php +++ b/wp-includes/bookmark-template.php @@ -9,23 +9,28 @@ **/ function wp_get_links($args = '') { global $wpdb; - - if ( strpos( $args, '=' ) === false ) { + + if ( empty($args) ) + return; + + if ( false === strpos($args, '=') ) { $cat_id = $args; - $args = add_query_arg( 'category', $cat_id, $args ); + $args = add_query_arg('category', $cat_id, $args); } - - $defaults = array( - 'category' => -1, 'before' => '', - 'after' => '<br />', 'between' => ' ', - 'show_images' => true, 'orderby' => 'name', - 'show_description' => true, 'show_rating' => false, - 'limit' => -1, 'show_updated' => true, - 'echo' => true - ); - - $r = wp_parse_args( $args, $defaults ); - extract( $r ); + + parse_str($args); + + if ( !isset($category) ) $category = -1; + if ( !isset($before) ) $before = ''; + if ( !isset($after) ) $after = '<br />'; + if ( !isset($between) ) $between = ' '; + if ( !isset($show_images) ) $show_images = true; + if ( !isset($orderby) ) $orderby = 'name'; + if ( !isset($show_description) ) $show_description = true; + if ( !isset($show_rating) ) $show_rating = false; + if ( !isset($limit) ) $limit = -1; + if ( !isset($show_updated) ) $show_updated = 1; + if ( !isset($echo) ) $echo = true; return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo); } // end wp_get_links @@ -240,14 +245,15 @@ function get_links_list($order = 'name', $hide_if_empty = 'obsolete') { } function _walk_bookmarks($bookmarks, $args = '' ) { - $defaults = array( - 'show_updated' => 0, 'show_description' => 0, - 'show_images' => 1, 'before' => '<li>', - 'after' => '</li>', 'between' => "\n" - ); - - $r = wp_parse_args( $args, $defaults ); - extract( $r ); + if ( is_array($args) ) + $r = &$args; + else + parse_str($args, $r); + + $defaults = array('show_updated' => 0, 'show_description' => 0, 'show_images' => 1, 'before' => '<li>', + 'after' => '</li>', 'between' => "\n"); + $r = array_merge($defaults, $r); + extract($r, EXTR_SKIP); foreach ( (array) $bookmarks as $bookmark ) { if ( !isset($bookmark->recently_updated) ) @@ -314,20 +320,18 @@ function _walk_bookmarks($bookmarks, $args = '' ) { } function wp_list_bookmarks($args = '') { - $defaults = array( - 'orderby' => 'name', 'order' => 'ASC', - 'limit' => -1, 'category' => '', - 'category_name' => '', 'hide_invisible' => 1, - 'show_updated' => 0, 'echo' => 1, - 'categorize' => 1, 'title_li' => __('Bookmarks'), - 'title_before' => '<h2>', 'title_after' => '</h2>', - 'category_orderby' => 'name', 'category_order' => 'ASC', - 'class' => 'linkcat', 'category_before' => '<li id="%id" class="%class">', - 'category_after' => '</li>' - ); - - $r = wp_parse_args( $args, $defaults ); - extract( $r ); + if ( is_array($args) ) + $r = &$args; + else + parse_str($args, $r); + + $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '', + 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'echo' => 1, + 'categorize' => 1, 'title_li' => __('Bookmarks'), 'title_before' => '<h2>', 'title_after' => '</h2>', + 'category_orderby' => 'name', 'category_order' => 'ASC', 'class' => 'linkcat', + 'category_before' => '<li id="%id" class="%class">', 'category_after' => '</li>'); + $r = array_merge($defaults, $r); + extract($r, EXTR_SKIP); $output = ''; |