summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wp-admin/admin-db.php3
-rw-r--r--wp-includes/bookmark.php8
-rw-r--r--wp-includes/category.php15
-rw-r--r--wp-includes/kses.php2
-rw-r--r--wp-includes/post.php19
-rw-r--r--wp-includes/wpmu-functions.php15
-rw-r--r--xmlrpc.php4
7 files changed, 39 insertions, 27 deletions
diff --git a/wp-admin/admin-db.php b/wp-admin/admin-db.php
index ea6e60d..27c422f 100644
--- a/wp-admin/admin-db.php
+++ b/wp-admin/admin-db.php
@@ -139,6 +139,7 @@ function wp_insert_category($catarr) {
}
wp_cache_delete($cat_ID, 'category');
+ wp_cache_delete('get_categories', 'category');
if ($update) {
do_action('edit_category', $cat_ID);
@@ -220,6 +221,7 @@ function wp_delete_category($cat_ID) {
wp_cache_delete($cat_ID, 'category');
wp_cache_delete('all_category_ids', 'category');
+ wp_cache_delete('get_categories', 'category');
do_action('delete_category', $cat_ID);
@@ -413,6 +415,7 @@ function wp_delete_link($link_id) {
foreach ( $categories as $category ) {
$wpdb->query("UPDATE $wpdb->categories SET link_count = link_count - 1 WHERE cat_ID = '$category'");
wp_cache_delete($category, 'category');
+ do_action('edit_category', $cat_id);
}
}
diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php
index 2824a89..dc98d9d 100644
--- a/wp-includes/bookmark.php
+++ b/wp-includes/bookmark.php
@@ -19,7 +19,7 @@ function get_bookmark($bookmark_id, $output = OBJECT) {
// Deprecate
function get_link($bookmark_id, $output = OBJECT) {
- return get_bookmark($bookmark_id, $output);
+ return get_bookmark($bookmark_id, $output);
}
function get_bookmarks($args = '') {
@@ -55,7 +55,7 @@ function get_bookmarks($args = '') {
}
}
}
- if (!empty($inclusions))
+ if (!empty($inclusions))
$inclusions .= ')';
$exclusions = '';
@@ -70,7 +70,7 @@ function get_bookmarks($args = '') {
}
}
}
- if (!empty($exclusions))
+ if (!empty($exclusions))
$exclusions .= ')';
if ( ! empty($category_name) ) {
@@ -92,7 +92,7 @@ function get_bookmarks($args = '') {
}
}
if (!empty($category_query)) {
- $category_query .= ')';
+ $category_query .= ')';
$join = " LEFT JOIN $wpdb->link2cat ON ($wpdb->links.link_id = $wpdb->link2cat.link_id) ";
}
diff --git a/wp-includes/category.php b/wp-includes/category.php
index 7b3e7ca..690c196 100644
--- a/wp-includes/category.php
+++ b/wp-includes/category.php
@@ -225,6 +225,21 @@ function get_cat_name($cat_id) {
return $category->cat_name;
}
+function cat_is_ancestor_of($cat1, $cat2) {
+ if ( is_int($cat1) )
+ $cat1 = & get_category($cat1);
+ if ( is_int($cat2) )
+ $cat2 = & get_category($cat2);
+
+ if ( !$cat1->cat_ID || !$cat2->category_parent )
+ return false;
+
+ if ( $cat2->category_parent == $cat1->cat_ID )
+ return true;
+
+ return cat_is_ancestor_of($cat1, get_category($cat2->parent_category));
+}
+
//
// Private
//
diff --git a/wp-includes/kses.php b/wp-includes/kses.php
index 99612a0..4a5bd94 100644
--- a/wp-includes/kses.php
+++ b/wp-includes/kses.php
@@ -822,6 +822,7 @@ function kses_init_filters() {
// Post filtering
add_filter('content_save_pre', 'wp_filter_post_kses');
+ add_filter('content_filtered_save_pre', 'wp_filter_post_kses');
add_filter('pre_comment_author', 'wp_filter_kses');
add_action('admin_notices', 'wp_kses_show_message');
}
@@ -833,6 +834,7 @@ function kses_remove_filters() {
// Post filtering
remove_filter('content_save_pre', 'wp_filter_post_kses');
+ remove_filter('content_filtered_save_pre', 'wp_filter_post_kses');
}
function wp_filter_post_display_kses($data) {
diff --git a/wp-includes/post.php b/wp-includes/post.php
index 642f664..de3ec95 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -402,6 +402,7 @@ function wp_delete_post($postid = 0) {
foreach ( $categories as $cat_id ) {
$wpdb->query("UPDATE $wpdb->categories SET category_count = category_count - 1 WHERE cat_ID = '$cat_id'");
wp_cache_delete($cat_id, 'category');
+ do_action('edit_category', $cat_id);
}
}
}
@@ -417,8 +418,9 @@ function wp_delete_post($postid = 0) {
$wpdb->query("DELETE FROM $wpdb->postmeta WHERE post_id = $postid");
- if ( 'page' == $post->type ) {
- wp_cache_delete('all_page_ids', 'pages');
+ if ( 'page' == $post->post_type ) {
+ wp_cache_delete( 'all_page_ids', 'pages' );
+ wp_cache_delete( 'get_pages', 'page' );
$wp_rewrite->flush_rules();
}
@@ -495,6 +497,7 @@ function wp_insert_post($postarr = array()) {
// Get the basics.
if ( empty($no_filter) ) {
$post_content = apply_filters('content_save_pre', $post_content);
+ $post_content_filtered = apply_filters('content_filtered_save_pre', $post_content_filtered);
$post_excerpt = apply_filters('excerpt_save_pre', $post_excerpt);
$post_title = apply_filters('title_save_pre', $post_title);
$post_category = apply_filters('category_save_pre', $post_category);
@@ -679,7 +682,8 @@ function wp_insert_post($postarr = array()) {
wp_schedule_single_event(time(), 'do_pings');
}
} else if ($post_type == 'page') {
- wp_cache_delete('all_page_ids', 'pages');
+ wp_cache_delete( 'all_page_ids', 'pages' );
+ wp_cache_delete( 'get_pages', 'page' );
$wp_rewrite->flush_rules();
if ( !empty($page_template) )
@@ -809,6 +813,8 @@ function wp_set_post_categories($post_ID = 0, $post_categories = array()) {
do_action('edit_category', $cat_id);
}
+ wp_cache_delete('get_categories', 'category');
+
do_action('edit_post', $post_ID);
} // wp_set_post_categories()
@@ -1059,7 +1065,7 @@ function &get_pages($args = '') {
$inclusions = '';
if ( !empty($include) ) {
$child_of = 0; //ignore child_of, exclude, meta_key, and meta_value params if using include
- $exclude = '';
+ $exclude = '';
$meta_key = '';
$meta_value = '';
$incpages = preg_split('/[\s,]+/',$include);
@@ -1072,8 +1078,8 @@ function &get_pages($args = '') {
}
}
}
- if (!empty($inclusions))
- $inclusions .= ')';
+ if (!empty($inclusions))
+ $inclusions .= ')';
$exclusions = '';
if ( !empty($exclude) ) {
@@ -1209,6 +1215,7 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) {
// Get the basics.
$post_content = apply_filters('content_save_pre', $post_content);
+ $post_content_filtered = apply_filters('content_filtered_save_pre', $post_content_filtered);
$post_excerpt = apply_filters('excerpt_save_pre', $post_excerpt);
$post_title = apply_filters('title_save_pre', $post_title);
$post_category = apply_filters('category_save_pre', $post_category);
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php
index e4040c5..ec9746c 100644
--- a/wp-includes/wpmu-functions.php
+++ b/wp-includes/wpmu-functions.php
@@ -1387,19 +1387,4 @@ function get_current_site() {
return $current_site;
}
-function cat_is_ancestor_of($cat1, $cat2) {
- if ( is_int($cat1) )
- $cat1 = & get_category($cat1);
- if ( is_int($cat2) )
- $cat2 = & get_category($cat2);
-
- if ( !$cat1->cat_ID || !$cat2->category_parent )
- return false;
-
- if ( $cat2->category_parent == $cat1->cat_ID )
- return true;
-
- return cat_is_ancestor_of($cat1, get_category($cat2->parent_category));
-}
-
?>
diff --git a/xmlrpc.php b/xmlrpc.php
index 94226dd..6153e50 100644
--- a/xmlrpc.php
+++ b/xmlrpc.php
@@ -1219,10 +1219,10 @@ class wp_xmlrpc_server extends IXR_Server {
$comment_post_ID = (int) $post_ID;
$comment_author = $title;
- $wpdb->escape($comment_author);
+ $this->escape($comment_author);
$comment_author_url = $pagelinkedfrom;
$comment_content = $context;
- $wpdb->escape($comment_content);
+ $this->escape($comment_content);
$comment_type = 'pingback';
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_content', 'comment_type');