From e7b243973132b555e66a0517e25232ba213bc35e Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 7 Dec 2006 10:17:25 +0000 Subject: WP Merge git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@819 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/admin-functions.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'wp-admin/admin-functions.php') diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 624b693..160dcc7 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -722,6 +722,7 @@ function cat_rows( $parent = 0, $level = 0, $categories = 0 ) { $categories = get_categories( 'hide_empty=0' ); if ( $categories ) { + ob_start(); foreach ( $categories as $category ) { if ( $category->cat_ID == 0 ) { // HACK, added 2006-05-13 $wpdb->query("DELETE FROM $wpdb->categories WHERE cat_ID = 0"); @@ -732,6 +733,12 @@ function cat_rows( $parent = 0, $level = 0, $categories = 0 ) { cat_rows( $category->cat_ID, $level +1, $categories ); } } + $output = ob_get_contents(); + ob_end_clean(); + + $output = apply_filters('cat_rows', $output); + + echo $output; } else { return false; } @@ -826,11 +833,13 @@ function user_row( $user_object, $style = '' ) { if ( $numposts > 0 ) { $r .= ""; $r .= sprintf( __('View %1$s %2$s' ), $numposts, __ngettext( 'post', 'posts', $numposts )); + $r .= ''; } $r .= "\n\t\t"; - $edit_link = add_query_arg( 'wp_http_referer', wp_specialchars( urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$user_object->ID" ); - if ( ( is_site_admin() || $current_user->ID == $user_object->ID ) && current_user_can('edit_user', $user_object->ID) ) + if ( ( is_site_admin() || $current_user->ID == $user_object->ID ) && current_user_can( 'edit_user', $user_object->ID ) ) { + $edit_link = wp_specialchars( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), "user-edit.php?user_id=$user_object->ID" ) ); $r .= "".__( 'Edit' ).""; + } $r .= "\n\t"; return $r; } @@ -1296,8 +1305,8 @@ function get_page_templates() { if ( is_array( $templates ) ) { foreach ( $templates as $template ) { $template_data = implode( '', file( ABSPATH.$template )); - preg_match( "|Template Name:(.* )|i", $template_data, $name ); - preg_match( "|Description:(.* )|i", $template_data, $description ); + preg_match( "|Template Name:(.*)|i", $template_data, $name ); + preg_match( "|Description:(.*)|i", $template_data, $description ); $name = $name[1]; $description = $description[1]; @@ -2020,7 +2029,7 @@ function the_attachment_links( $id = false ) { return false; $icon = get_attachment_icon( $post->ID ); - $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); + $attachment_data = wp_get_attachment_metadata( $id ); $thumb = isset( $attachment_data['thumb'] ); ?>