Changeset 5444
- Timestamp:
- 05/11/2007 03:10:05 AM (18 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/author-template.php
r5135 r5444 176 176 global $wpdb; 177 177 178 if ( is_array($args) ) 179 $r = &$args; 180 else 181 parse_str($args, $r); 182 183 $defaults = array('optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false, 'hide_empty' => true, 184 'feed' => '', 'feed_image' => ''); 185 $r = array_merge($defaults, $r); 178 $defaults = array( 179 'optioncount' => false, 'exclude_admin' => true, 180 'show_fullname' => false, 'hide_empty' => true, 181 'feed' => '', 'feed_image' => '' 182 ); 183 184 $r = wp_parse_args( $args, $defaults ); 186 185 extract($r); 187 186 -
trunk/wp-includes/bookmark-template.php
r5153 r5444 10 10 function wp_get_links($args = '') { 11 11 global $wpdb; 12 13 if ( empty($args) ) 14 return; 15 16 if ( false === strpos($args, '=') ) { 12 13 if ( strpos( $args, '=' ) === false ) { 17 14 $cat_id = $args; 18 $args = add_query_arg('category', $cat_id, $args); 19 } 20 21 parse_str($args); 22 23 if ( !isset($category) ) $category = -1; 24 if ( !isset($before) ) $before = ''; 25 if ( !isset($after) ) $after = '<br />'; 26 if ( !isset($between) ) $between = ' '; 27 if ( !isset($show_images) ) $show_images = true; 28 if ( !isset($orderby) ) $orderby = 'name'; 29 if ( !isset($show_description) ) $show_description = true; 30 if ( !isset($show_rating) ) $show_rating = false; 31 if ( !isset($limit) ) $limit = -1; 32 if ( !isset($show_updated) ) $show_updated = 1; 33 if ( !isset($echo) ) $echo = true; 15 $args = add_query_arg( 'category', $cat_id, $args ); 16 } 17 18 $defaults = array( 19 'category' => -1, 'before' => '', 20 'after' => '<br />', 'between' => ' ', 21 'show_images' => true, 'orderby' => 'name', 22 'show_description' => true, 'show_rating' => false, 23 'limit' => -1, 'show_updated' => true, 24 'echo' => true 25 ); 26 27 $r = wp_parse_args( $args, $defaults ); 28 extract( $r ); 34 29 35 30 return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo); … … 246 241 247 242 function _walk_bookmarks($bookmarks, $args = '' ) { 248 if ( is_array($args) ) 249 $r = &$args; 250 else 251 parse_str($args, $r); 252 253 $defaults = array('show_updated' => 0, 'show_description' => 0, 'show_images' => 1, 'before' => '<li>', 254 'after' => '</li>', 'between' => "\n"); 255 $r = array_merge($defaults, $r); 256 extract($r); 243 $defaults = array( 244 'show_updated' => 0, 'show_description' => 0, 245 'show_images' => 1, 'before' => '<li>', 246 'after' => '</li>', 'between' => "\n" 247 ); 248 249 $r = wp_parse_args( $args, $defaults ); 250 extract( $r ); 257 251 258 252 foreach ( (array) $bookmarks as $bookmark ) { … … 321 315 322 316 function wp_list_bookmarks($args = '') { 323 if ( is_array($args) ) 324 $r = &$args; 325 else 326 parse_str($args, $r); 327 328 $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '', 329 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'echo' => 1, 330 'categorize' => 1, 'title_li' => __('Bookmarks'), 'title_before' => '<h2>', 'title_after' => '</h2>', 331 'category_orderby' => 'name', 'category_order' => 'ASC', 'class' => 'linkcat', 332 'category_before' => '<li id="%id" class="%class">', 'category_after' => '</li>'); 333 $r = array_merge($defaults, $r); 334 extract($r); 317 $defaults = array( 318 'orderby' => 'name', 'order' => 'ASC', 319 'limit' => -1, 'category' => '', 320 'category_name' => '', 'hide_invisible' => 1, 321 'show_updated' => 0, 'echo' => 1, 322 'categorize' => 1, 'title_li' => __('Bookmarks'), 323 'title_before' => '<h2>', 'title_after' => '</h2>', 324 'category_orderby' => 'name', 'category_order' => 'ASC', 325 'class' => 'linkcat', 'category_before' => '<li id="%id" class="%class">', 326 'category_after' => '</li>' 327 ); 328 329 $r = wp_parse_args( $args, $defaults ); 330 extract( $r ); 335 331 336 332 $output = ''; -
trunk/wp-includes/bookmark.php
r5248 r5444 26 26 function get_bookmarks($args = '') { 27 27 global $wpdb; 28 29 if ( is_array($args) ) 30 $r = &$args; 31 else 32 parse_str($args, $r); 33 34 $defaults = array('orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '', 35 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'include' => '', 'exclude' => ''); 36 $r = array_merge($defaults, $r); 37 extract($r); 28 29 $defaults = array( 30 'orderby' => 'name', 'order' => 'ASC', 31 'limit' => -1, 'category' => '', 32 'category_name' => '', 'hide_invisible' => 1, 33 'show_updated' => 0, 'include' => '', 34 'exclude' => '' 35 ); 36 37 $r = wp_parse_args( $args, $defaults ); 38 extract( $r ); 38 39 39 40 $key = md5( serialize( $r ) ); -
trunk/wp-includes/category-template.php
r5265 r5444 170 170 171 171 function wp_dropdown_categories($args = '') { 172 if ( is_array($args) )173 $r = &$args;174 else175 parse_str($args, $r);176 177 $defaults = array('show_option_all' => '', 'show_option_none' => '', 'orderby' => 'ID',178 ' order' => 'ASC', 'show_last_update' => 0, 'show_count' => 0,179 ' hide_empty' => 1, 'child_of' => 0, 'exclude' => '', 'echo' => 1,180 'selected' => 0, 'hierarchical' => 0, 'name' => 'cat',181 'class' => 'postform');172 $defaults = array( 173 'show_option_all' => '', 'show_option_none' => '', 174 'orderby' => 'ID', 'order' => 'ASC', 175 'show_last_update' => 0, 'show_count' => 0, 176 'hide_empty' => 1, 'child_of' => 0, 177 'exclude' => '', 'echo' => 1, 178 'selected' => 0, 'hierarchical' => 0, 179 'name' => 'cat', 'class' => 'postform' 180 ); 181 182 182 $defaults['selected'] = ( is_category() ) ? get_query_var('cat') : 0; 183 $r = array_merge($defaults, $r); 183 184 $r = wp_parse_args( $args, $defaults ); 184 185 $r['include_last_update_time'] = $r['show_last_update']; 185 extract( $r);186 extract( $r ); 186 187 187 188 $categories = get_categories($r); … … 219 220 220 221 function wp_list_categories($args = '') { 221 if ( is_array($args) ) 222 $r = &$args; 223 else 224 parse_str($args, $r); 225 226 $defaults = array('show_option_all' => '', 'orderby' => 'name', 227 'order' => 'ASC', 'show_last_update' => 0, 'style' => 'list', 228 'show_count' => 0, 'hide_empty' => 1, 'use_desc_for_title' => 1, 229 'child_of' => 0, 'feed' => '', 'feed_image' => '', 'exclude' => '', 230 'hierarchical' => true, 'title_li' => __('Categories')); 231 $r = array_merge($defaults, $r); 232 if ( !isset($r['pad_counts']) && $r['show_count'] && $r['hierarchical'] ) 222 $defaults = array( 223 'show_option_all' => '', 'orderby' => 'name', 224 'order' => 'ASC', 'show_last_update' => 0, 225 'style' => 'list', 'show_count' => 0, 226 'hide_empty' => 1, 'use_desc_for_title' => 1, 227 'child_of' => 0, 'feed' => '', 228 'feed_image' => '', 'exclude' => '', 229 'hierarchical' => true, 'title_li' => __('Categories') 230 ); 231 232 $r = wp_parse_args( $args, $defaults ); 233 234 if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) { 233 235 $r['pad_counts'] = true; 234 if ( isset($r['show_date']) ) 236 } 237 238 if ( isset( $r['show_date'] ) ) { 235 239 $r['include_last_update_time'] = $r['show_date']; 236 extract($r); 237 240 } 241 242 extract( $r ); 243 238 244 $categories = get_categories($r); 239 245 -
trunk/wp-includes/category.php
r5295 r5444 17 17 function &get_categories($args = '') { 18 18 global $wpdb, $category_links; 19 20 if ( is_array($args) ) 21 $r = &$args; 22 else 23 parse_str($args, $r); 24 25 $defaults = array('type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 26 'hide_empty' => true, 'include_last_update_time' => false, 'hierarchical' => 1, 'exclude' => '', 'include' => '', 27 'number' => '', 'pad_counts' => false); 28 $r = array_merge($defaults, $r); 29 if ( 'count' == $r['orderby'] ) 19 20 $defaults = array( 21 'type' => 'post', 'child_of' => 0, 22 'orderby' => 'name', 'order' => 'ASC', 23 'hide_empty' => true, 'include_last_update_time' => false, 24 'hierarchical' => 1, 'exclude' => '', 25 'include' => '', 'number' => '', 26 'pad_counts' => false 27 ); 28 29 $r = wp_parse_args( $args, $defaults ); 30 31 if ( $r['orderby'] == 'count' ) { 30 32 $r['orderby'] = 'category_count'; 31 else 32 $r['orderby'] = "cat_" . $r['orderby']; // restricts order by to cat_ID and cat_name fields 33 $r['number'] = (int) $r['number']; 34 extract($r); 33 } else { 34 $r['orderby'] = 'cat_' . $r['orderby']; 35 } 36 37 extract( $r ); 35 38 36 39 $key = md5( serialize( $r ) ); -
trunk/wp-includes/classes.php
r5164 r5444 688 688 // a WP_Error object can be passed in 'id' or 'data' 689 689 function add( $args = '' ) { 690 if ( is_array($args) ) 691 $r = &$args; 692 else 693 parse_str($args, $r); 694 695 $defaults = array('what' => 'object', 'action' => false, 'id' => '0', 'old_id' => false, 696 'data' => '', 'supplemental' => array()); 697 698 $r = array_merge($defaults, $r); 699 extract($r); 690 $defaults = array( 691 'what' => 'object', 'action' => false, 692 'id' => '0', 'old_id' => false, 693 'data' => '', 'supplemental' => array() 694 ); 695 696 $r = wp_parse_args( $args, $defaults ); 697 extract( $r ); 700 698 701 699 if ( is_wp_error($id) ) { -
trunk/wp-includes/deprecated.php
r4791 r5444 428 428 429 429 function wp_list_cats($args = '') { 430 if ( is_array($args) ) 431 $r = &$args; 432 else 433 parse_str($args, $r); 430 $r = wp_parse_args( $args ); 434 431 435 432 // Map to new names. -
trunk/wp-includes/general-template.php
r5433 r5444 314 314 315 315 function wp_get_archives($args = '') { 316 global $wp _locale, $wpdb;317 318 if ( is_array($args) )319 $r = &$args;320 else321 parse_str($args, $r);322 323 $defaults = array('type' => 'monthly', 'limit' => '', 'format' => 'html', 'before' => '', 'after' => '', 'show_post_count' => false);324 $r = array_merge($defaults, $r);325 extract( $r);316 global $wpdb; 317 318 $defaults = array( 319 'type' => 'monthly', 'limit' => '', 320 'format' => 'html', 'before' => '', 321 'after' => '', 'show_post_count' => false 322 ); 323 324 $r = wp_parse_args( $args, $defaults ); 325 extract( $r ); 326 326 327 327 if ( '' == $type ) -
trunk/wp-includes/post-template.php
r5293 r5444 136 136 137 137 function wp_link_pages($args = '') { 138 global $post; 139 140 if ( is_array($args) ) 141 $r = &$args; 142 else 143 parse_str($args, $r); 144 145 $defaults = array('before' => '<p>' . __('Pages:'), 'after' => '</p>', 'next_or_number' => 'number', 'nextpagelink' => __('Next page'), 146 'previouspagelink' => __('Previous page'), 'pagelink' => '%', 'more_file' => '', 'echo' => 1); 147 $r = array_merge($defaults, $r); 148 extract($r); 149 150 global $id, $page, $numpages, $multipage, $more, $pagenow; 138 $defaults = array( 139 'before' => '<p>' . __('Pages:'), 'after' => '</p>', 140 'next_or_number' => 'number', 'nextpagelink' => __('Next page'), 141 'previouspagelink' => __('Previous page'), 'pagelink' => '%', 142 'more_file' => '', 'echo' => 1 143 ); 144 145 $r = wp_parse_args( $args, $defaults ); 146 extract( $r ); 147 148 global $post, $id, $page, $numpages, $multipage, $more, $pagenow; 151 149 if ( $more_file != '' ) 152 150 $file = $more_file; … … 252 250 253 251 function wp_dropdown_pages($args = '') { 254 if ( is_array($args) ) 255 $r = &$args; 256 else 257 parse_str($args, $r); 258 259 $defaults = array('depth' => 0, 'child_of' => 0, 'selected' => 0, 'echo' => 1, 260 'name' => 'page_id', 'show_option_none' => ''); 261 $r = array_merge($defaults, $r); 262 extract($r); 252 $defaults = array( 253 'depth' => 0, 'child_of' => 0, 254 'selected' => 0, 'echo' => 1, 255 'name' => 'page_id', 'show_option_none' => '' 256 ); 257 258 $r = wp_parse_args( $args, $defaults ); 259 extract( $r ); 263 260 264 261 $pages = get_pages($r); … … 282 279 283 280 function wp_list_pages($args = '') { 284 if ( is_array($args) ) 285 $r = &$args; 286 else 287 parse_str($args, $r); 288 289 $defaults = array('depth' => 0, 'show_date' => '', 'date_format' => get_option('date_format'), 290 'child_of' => 0, 'exclude' => '', 'title_li' => __('Pages'), 'echo' => 1, 'authors' => '', 'sort_column' => 'menu_order, post_title'); 291 $r = array_merge($defaults, $r); 281 $defaults = array( 282 'depth' => 0, 'show_date' => '', 283 'date_format' => get_option('date_format'), 284 'child_of' => 0, 'exclude' => '', 285 'title_li' => __('Pages'), 'echo' => 1, 286 'authors' => '', 'sort_column' => 'menu_order, post_title' 287 ); 288 289 $r = wp_parse_args( $args, $defaults ); 290 extract( $r ); 292 291 293 292 $output = ''; -
trunk/wp-includes/post.php
r5271 r5444 28 28 function &get_children($args = '', $output = OBJECT) { 29 29 global $post_cache, $wpdb, $blog_id; 30 31 if ( empty( $args) ) {32 if ( isset( $GLOBALS['post']) )33 $ r = array('post_parent' => & $GLOBALS['post']->post_parent);34 else30 31 if ( empty( $args ) ) { 32 if ( isset( $GLOBALS['post'] ) ) { 33 $args = 'post_parent=' . (int) $GLOBALS['post']->post_parent; 34 } else { 35 35 return false; 36 } elseif ( is_object($args) ) 37 $r = array('post_parent' => $post->post_parent); 38 elseif ( is_numeric($args) ) 39 $r = array('post_parent' => $args); 40 elseif ( is_array($args) ) 41 $r = &$args; 42 else 43 parse_str($args, $r); 44 45 $defaults = array('numberposts' => -1, 'post_type' => '', 'post_status' => '', 'post_parent' => 0); 46 $r = array_merge($defaults, $r); 36 } 37 } elseif ( is_object( $args ) ) { 38 $args = 'post_parent=' . (int) $args->post_parent; 39 } elseif ( is_numeric( $args ) ) { 40 $args = 'post_parent=' . (int) $args; 41 } 42 43 $defaults = array( 44 'numberposts' => -1, 'post_type' => '', 45 'post_status' => '', 'post_parent' => 0 46 ); 47 48 $r = wp_parse_args( $args, $defaults ); 47 49 48 50 $children = get_posts( $r ); … … 173 175 function get_posts($args) { 174 176 global $wpdb; 175 176 if ( is_array($args) ) 177 $r = &$args; 178 else 179 parse_str($args, $r); 180 181 $defaults = array('numberposts' => 5, 'offset' => 0, 'category' => 0, 182 'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 183 'meta_key' => '', 'meta_value' =>'', 'post_type' => 'post', 'post_status' => 'publish', 'post_parent' => 0); 184 $r = array_merge($defaults, $r); 185 extract($r); 177 178 $defaults = array( 179 'numberposts' => 5, 'offset' => 0, 180 'category' => 0, 'orderby' => 'post_date', 181 'order' => 'DESC', 'include' => '', 182 'exclude' => '', 'meta_key' => '', 183 'meta_value' =>'', 'post_type' => 'post', 184 'post_status' => 'publish', 'post_parent' => 0 185 ); 186 187 $r = wp_parse_args( $args, $defaults ); 188 extract( $r ); 189 186 190 $numberposts = (int) $numberposts; 187 191 $offset = (int) $offset; … … 1164 1168 function &get_pages($args = '') { 1165 1169 global $wpdb; 1166 1167 if ( is_array($args) ) 1168 $r = &$args; 1169 else 1170 parse_str($args, $r); 1171 1172 $defaults = array('child_of' => 0, 'sort_order' => 'ASC', 'sort_column' => 'post_title', 1173 'hierarchical' => 1, 'exclude' => '', 'include' => '', 'meta_key' => '', 'meta_value' => '', 'authors' => ''); 1174 $r = array_merge($defaults, $r); 1175 extract($r); 1170 1171 $defaults = array( 1172 'child_of' => 0, 'sort_order' => 'ASC', 1173 'sort_column' => 'post_title', 'hierarchical' => 1, 1174 'exclude' => '', 'include' => '', 1175 'meta_key' => '', 'meta_value' => '', 1176 'authors' => '' 1177 ); 1178 1179 $r = wp_parse_args( $args, $defaults ); 1180 extract( $r ); 1176 1181 1177 1182 $key = md5( serialize( $r ) );
Note: See TracChangeset
for help on using the changeset viewer.