diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-08-31 09:50:02 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-08-31 09:50:02 +0000 |
| commit | f9d834aed9c0c6cba6faf7777e7952bf2cd8e4a5 (patch) | |
| tree | 239419a4308e9639822269ff5eb935262cbd46a3 | |
| parent | ad74c2c392bcdd0b8f2eee0e4d9cd0c2309617e3 (diff) | |
WP Core Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@261 7be80a69-a1ef-0310-a953-fb0f7c49ff36
| -rw-r--r-- | wp-inst/wp-admin/admin-functions.php | 27 | ||||
| -rw-r--r-- | wp-inst/wp-admin/edit-comments.php | 8 | ||||
| -rw-r--r-- | wp-inst/wp-admin/list-manipulation.php | 81 | ||||
| -rw-r--r-- | wp-inst/wp-admin/users.php | 7 | ||||
| -rw-r--r-- | wp-inst/wp-includes/classes.php | 2 | ||||
| -rw-r--r-- | wp-inst/wp-includes/comment-functions.php | 2 | ||||
| -rw-r--r-- | wp-inst/wp-includes/functions-post.php | 6 | ||||
| -rw-r--r-- | wp-inst/wp-includes/pluggable-functions.php | 9 | ||||
| -rw-r--r-- | wp-inst/wp-includes/template-functions-category.php | 2 |
9 files changed, 121 insertions, 23 deletions
diff --git a/wp-inst/wp-admin/admin-functions.php b/wp-inst/wp-admin/admin-functions.php index 1a5c8cc..c23d5d0 100644 --- a/wp-inst/wp-admin/admin-functions.php +++ b/wp-inst/wp-admin/admin-functions.php @@ -264,7 +264,8 @@ function wp_insert_category($catarr) { do_action('edit_category', $cat_ID); } else { $rval = $wpdb->insert_id; - do_action('create_category', $cat_ID); + do_action('create_category', $rval); + do_action('add_category', $rval); } list( $update, $cat_ID, $category_nicename, $cat_name, $rval ) = apply_filters( "new_category", $update, $cat_ID, $category_nicename, $cat_name, $rval ); @@ -443,12 +444,12 @@ function cat_rows($parent = 0, $level = 0, $categories = 0) { $count = $wpdb->get_var("SELECT COUNT(post_id) FROM $wpdb->post2cat WHERE category_id = $category->cat_ID"); $pad = str_repeat('— ', $level); if ( current_user_can('manage_categories') ) - $edit = "<a href='categories.php?action=edit&cat_ID=$category->cat_ID' class='edit'>" . __('Edit') . "</a></td><td><a href='categories.php?action=delete&cat_ID=$category->cat_ID' onclick=\"return confirm('". sprintf(__("You are about to delete the category \'%s\'. All of its posts will go to the default category.\\n \'OK\' to delete, \'Cancel\' to stop."), $wpdb->escape($category->cat_name)) . "')\" class='delete'>" . __('Delete') . "</a>"; + $edit = "<a href='categories.php?action=edit&cat_ID=$category->cat_ID' class='edit'>" . __('Edit') . "</a></td><td><a href='categories.php?action=delete&cat_ID=$category->cat_ID' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . sprintf(__("You are about to delete the category "%s". All of its posts will go to the default category.\\n"OK" to delete, "Cancel" to stop."), wp_specialchars($category->cat_name, 1)) . "' );\" class='delete'>" . __('Delete') . "</a>"; else $edit = ''; $class = ('alternate' == $class) ? '' : 'alternate'; - echo "<tr class='$class'><th scope='row'>$category->cat_ID</th><td>$pad $category->cat_name</td> + echo "<tr id='cat-$category->cat_ID' class='$class'><th scope='row'>$category->cat_ID</th><td>$pad $category->cat_name</td> <td>$category->category_description</td> <td>$count</td> <td>$edit</td> @@ -474,7 +475,7 @@ function page_rows( $parent = 0, $level = 0, $pages = 0 ) { $id = $post->ID; $class = ('alternate' == $class) ? '' : 'alternate'; ?> - <tr class='<?php echo $class; ?>'> + <tr id='page-<?php echo $id; ?>' class='<?php echo $class; ?>'> <th scope="row"><?php echo $post->ID; ?></th> <td> <?php echo $pad; ?><?php the_title() ?> @@ -483,7 +484,7 @@ function page_rows( $parent = 0, $level = 0, $pages = 0 ) { <td><?php echo mysql2date('Y-m-d g:i a', $post->post_modified); ?></td> <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td> <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='post.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td> - <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='post.php?action=delete&post=$id' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n \'OK\' to delete, \'Cancel\' to stop."), the_title('','',0)) . "')\">" . __('Delete') . "</a>"; } ?></td> + <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='post.php?action=delete&post=$id' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the "%s" page.\\n"OK" to delete, "Cancel" to stop."), wp_specialchars(get_the_title('','',0), 1)) . "' );\">" . __('Delete') . "</a>"; } ?></td> </tr> <?php @@ -1213,16 +1214,16 @@ $wp_file_descriptions = array( 'index.php' => __('Main Index Template'), 'style.css' => __('Stylesheet'), - 'comments.php' => __('Comments Template'), - 'comments-popup.php' => __('Popup Comments Template'), - 'footer.php' => __('Footer Template'), - 'header.php' => __('Header Template'), - 'sidebar.php' => __('Sidebar Template'), - 'archive.php' => __('Archive Template'), + 'comments.php' => __('Comments'), + 'comments-popup.php' => __('Popup Comments'), + 'footer.php' => __('Footer'), + 'header.php' => __('Header'), + 'sidebar.php' => __('Sidebar'), + 'archive.php' => __('Archives'), 'category.php' => __('Category Template'), 'page.php' => __('Page Template'), - 'search.php' => __('Search Template'), - 'single.php' => __('Post Template'), + 'search.php' => __('Search Results'), + 'single.php' => __('Single Post'), '404.php' => __('404 Template'), 'my-hacks.php' => __('my-hacks.php (legacy hacks support)'), '.htaccess' => __('.htaccess (for rewrite rules)'), diff --git a/wp-inst/wp-admin/edit-comments.php b/wp-inst/wp-admin/edit-comments.php index 57ca597..3faf7e1 100644 --- a/wp-inst/wp-admin/edit-comments.php +++ b/wp-inst/wp-admin/edit-comments.php @@ -76,7 +76,7 @@ if ('view' == $mode) { else $start = ''; - echo "<ol class='commentlist' $start>"; + echo "<ol id='the-list' class='commentlist' $start>"; $i = 0; foreach ($comments as $comment) { ++$i; $class = ''; @@ -86,7 +86,7 @@ if ('view' == $mode) { $class .= ' unapproved'; if ($i % 2) $class .= ' alternate'; - echo "<li class='$class'>"; + echo "<li id='comment-$comment->comment_ID' class='$class'>"; ?> <p><strong><?php _e('Name:') ?></strong> <?php comment_author() ?> <?php if ($comment->comment_author_email) { ?>| <strong><?php _e('E-mail:') ?></strong> <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url ) { ?> | <strong><?php _e('URI:') ?></strong> <?php comment_author_url_link() ?> <?php } ?>| <strong><?php _e('IP:') ?></strong> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p> @@ -97,7 +97,7 @@ if ('view' == $mode) { echo " | <a href=\"post.php?action=editcomment&comment=".$comment->comment_ID."\">" . __('Edit Comment') . "</a>"; } if ( current_user_can('edit_post', $comment->comment_post_ID) ) { - echo " | <a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n \'Cancel\' to stop, \'OK\' to delete."), $comment->comment_author) . "')\">" . __('Delete Comment') . "</a> — "; + echo " | <a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), wp_specialchars( $comment->comment_author, 1 )) . "' );\">" . __('Delete Comment') . "</a> — "; } // end if any comments to show // Get post title if ( current_user_can('edit_post', $comment->comment_post_ID) ) { @@ -111,6 +111,8 @@ if ('view' == $mode) { <?php } // end foreach ?> </ol> +<div id="ajax-response"></div> + <?php } else { diff --git a/wp-inst/wp-admin/list-manipulation.php b/wp-inst/wp-admin/list-manipulation.php new file mode 100644 index 0000000..b24ef33 --- /dev/null +++ b/wp-inst/wp-admin/list-manipulation.php @@ -0,0 +1,81 @@ +<?php +require_once('../wp-config.php'); +require_once('admin-functions.php'); + +get_currentuserinfo(); +if ( !$current_user ) + die('-1'); + +function grab_results() { + global $ajax_results; + $ajax_results = func_get_arg(0); +} + +function get_out_now() { exit; } +add_action('shutdown', 'get_out_now', -1); + +// check_admin_referer(); + +switch ( $_POST['action'] ) : +case 'delete-link' : + $id = (int) $_POST['id']; + if ( !current_user_can('manage_links') ) + die ('-1'); + + if ( $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$id'") ) + die('1'); + else die('0'); + break; +case 'delete-post' : +case 'delete-page' : + $id = (int) $_POST['id']; + if ( !current_user_can('edit_post', $post_id) ) + die('-1'); + + if ( wp_delete_post($id) ) + die('1'); + else die('0'); + break; +case 'delete-cat' : + if ( !current_user_can('manage_categories') ) + die ('-1'); + + $id = (int) $_POST['id']; + $cat_name = get_catname($cat_ID); + + if ( wp_delete_category($id) ) + die('1'); + else die('0'); + break; +case 'delete-comment' : + $id = (int) $_POST['id']; + + if ( !$comment = get_comment($id) ) + die('0'); + if ( !current_user_can('edit_post', $comment->comment_post_ID) ) + die('-1'); + + if ( wp_set_comment_status($comment->comment_ID, "delete") ) { + do_action('delete_comment', $comment->comment_ID); + die('1'); + } else { + die('0'); + } + break; +case 'delete-link-category' : + $id = (int) $_POST['id']; + if ( 1 == $id ) + die('0'); + if ( !current_user_can('manage_links') ) + die('-1'); + + if ( $wpdb->query("DELETE FROM $wpdb->linkcategories WHERE cat_id='$id'") ) { + $wpdb->query("UPDATE $wpdb->links SET link_category=1 WHERE link_category='$id'"); + die('1'); + } else { + die('0'); + } + break; +endswitch; +?> + diff --git a/wp-inst/wp-admin/users.php b/wp-inst/wp-admin/users.php index 452650b..62284b4 100644 --- a/wp-inst/wp-admin/users.php +++ b/wp-inst/wp-admin/users.php @@ -172,7 +172,7 @@ case 'adduser': if(count($errors) == 0) { $user_ID = create_user( $new_user_login, $new_pass1, $new_user_email, 0 ); - + update_usermeta( $user_ID, 'first_name', $new_user_firstname); update_usermeta( $user_ID, 'last_name', $new_user_lastname); update_usermeta( $user_ID, 'first_name', $new_user_firstname); @@ -190,6 +190,9 @@ case 'adduser': $message .= sprintf(__('E-mail: %s'), $new_user_email) . "\r\n"; @wp_mail(get_settings('admin_email'), sprintf(__('[%s] New User Registration'), get_settings('blogname')), $message); + + do_action('user_register', $user_id); + header('Location: users.php?update=add'); die(); } @@ -292,7 +295,7 @@ default: <tr> <th colspan="8" align="left"> <h3><?php echo $wp_roles->role_names[$role]; ?></h3> - </th> + </th></tr> <tr> <th><?php _e('ID') ?></th> diff --git a/wp-inst/wp-includes/classes.php b/wp-inst/wp-includes/classes.php index a8bd5b0..d027514 100644 --- a/wp-inst/wp-includes/classes.php +++ b/wp-inst/wp-includes/classes.php @@ -1323,6 +1323,8 @@ class WP { if (! empty($extra_query_vars)) parse_str($extra_query_vars, $extra_query_vars); + else + $extra_query_vars = array(); // Process PATH_INFO, REQUEST_URI, and 404 for permalinks. if ((isset($_GET['error']) && $_GET['error'] == '404') || diff --git a/wp-inst/wp-includes/comment-functions.php b/wp-inst/wp-includes/comment-functions.php index 227697a..c62ed97 100644 --- a/wp-inst/wp-includes/comment-functions.php +++ b/wp-inst/wp-includes/comment-functions.php @@ -513,7 +513,7 @@ function discover_pingback_server_uri($url, $timeout_bytes = 2048) { // Send the GET request $request = "GET $path HTTP/1.1\r\nHost: $host\r\nUser-Agent: WordPress/$wp_version PHP/" . phpversion() . "\r\n\r\n"; - ob_end_flush(); +// ob_end_flush(); fputs($fp, $request); // Let's check for an X-Pingback header first diff --git a/wp-inst/wp-includes/functions-post.php b/wp-inst/wp-includes/functions-post.php index 87c9e1a..f79be3e 100644 --- a/wp-inst/wp-includes/functions-post.php +++ b/wp-inst/wp-includes/functions-post.php @@ -155,9 +155,9 @@ function wp_insert_post($postarr = array()) { if ($post_status == 'publish') { do_action('publish_post', $post_ID); if ($post_pingback) - pingback($post_content, $post_ID); - do_enclose( $post_content, $post_ID ); - do_trackbacks($post_ID); + register_shutdown_function('pingback', $content, $post_ID); + register_shutdown_function('do_enclose', $content, $post_ID ); + register_shutdown_function('do_trackbacks', $post_ID); } else if ($post_status == 'static') { generate_page_rewrite_rules(); diff --git a/wp-inst/wp-includes/pluggable-functions.php b/wp-inst/wp-includes/pluggable-functions.php index 63fe56f..cb24b8c 100644 --- a/wp-inst/wp-includes/pluggable-functions.php +++ b/wp-inst/wp-includes/pluggable-functions.php @@ -268,6 +268,10 @@ function wp_notify_postauthor($comment_id, $comment_type='') { . "$from\n" . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n"; + $notify_message = apply_filters('comment_notification_text', $notify_message); + $subject = apply_filters('comment_notification_subject', $subject); + $message_headers = apply_filters('comment_notification_headers', $message_headers); + @wp_mail($user->user_email, $subject, $notify_message, $message_headers); return true; @@ -305,7 +309,10 @@ function wp_notify_moderator($comment_id) { $notify_message .= get_settings('siteurl') . "/wp-admin/moderation.php\r\n"; $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_settings('blogname'), $post->post_title ); - $admin_email = get_settings("admin_email"); + $admin_email = get_settings('admin_email'); + + $notify_message = apply_filters('comment_moderation_text', $notify_message); + $subject = apply_filters('comment_moderation_subject', $subject); @wp_mail($admin_email, $subject, $notify_message); diff --git a/wp-inst/wp-includes/template-functions-category.php b/wp-inst/wp-includes/template-functions-category.php index d1d4fb8..bb934f0 100644 --- a/wp-inst/wp-includes/template-functions-category.php +++ b/wp-inst/wp-includes/template-functions-category.php @@ -262,6 +262,8 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde } } + $exclusions = apply_filters('list_cats_exclusions', $exclusions ); + if (intval($categories)==0){ $sort_column = 'cat_'.$sort_column; |
