diff options
-rw-r--r-- | wp-admin/admin-ajax.php | 4 | ||||
-rw-r--r-- | wp-admin/edit.php | 6 | ||||
-rw-r--r-- | wp-admin/includes/post.php | 18 | ||||
-rw-r--r-- | wp-admin/js/edit-posts.js | 2 | ||||
-rw-r--r-- | wp-includes/js/wp-lists.js | 3 | ||||
-rw-r--r-- | wp-includes/script-loader.php | 4 | ||||
-rw-r--r-- | wp-includes/taxonomy.php | 38 |
7 files changed, 44 insertions, 31 deletions
diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 8d15c9c..64c9b06 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -15,7 +15,9 @@ switch ( $action = $_POST['action'] ) : case 'add-post' : check_ajax_referer( 'add-post' ); add_filter( 'post_limits', $limit_filter = create_function( '$a', '$b = split(" ",$a); if ( !isset($b[2]) ) return $a; $start = intval(trim($b[1])) / 20 * 15; if ( !is_int($start) ) return $a; $start += intval(trim($b[2])) - 1; return "LIMIT $start, 1";' ) ); - wp_edit_posts_query( '_POST' ); + wp_edit_posts_query( $_POST ); + if ( !have_posts() ) + die('1'); $posts_columns = wp_manage_posts_columns(); ob_start(); include( 'edit-post-rows.php' ); diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 06ab9ca..6e8d978 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -108,8 +108,6 @@ if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ? <?php wp_dropdown_categories('show_option_all='.__('All').'&hide_empty=1&hierarchical=1&show_count=1&selected='.$cat);?> </fieldset> <input type="submit" id="post-query-submit" value="<?php _e('Filter »'); ?>" class="button" /> - <?php wp_nonce_field( 'add-post', '_ajax_nonce', false ); ?> - <input type="button" id="get-extra-button" class="add:the-extra-list:searchform" style="display:none" /> </form> <?php do_action('restrict_manage_posts'); ?> @@ -118,6 +116,10 @@ if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ? <?php include( 'edit-post-rows.php' ); ?> +<form action="" method="post" id="get-extra-posts" class="add:the-extra-list:" style="display:none"> + <?php wp_nonce_field( 'add-post', '_ajax_nonce', false ); ?> +</form> + <div id="ajax-response"></div> <div class="navigation"> diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index b88e3b0..3c9cc77 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -476,10 +476,12 @@ function _relocate_children( $old_ID, $new_ID ) { return $wpdb->query( "UPDATE $wpdb->posts SET post_parent = $new_ID WHERE post_parent = $old_ID" ); } -function wp_edit_posts_query( $q = '_GET' ) { +function wp_edit_posts_query( $q = false ) { global $wpdb; - $$q['m'] = (int) $$q['m']; - $$q['cat'] = (int) $$q['cat']; + if ( false === $q ) + $q = $_GET; + $q['m'] = (int) $q['m']; + $q['cat'] = (int) $q['cat']; $post_stati = array( // array( adj, noun ) 'draft' => array(__('Draft'), _c('Drafts|manage posts header')), 'future' => array(__('Scheduled'), __('Scheduled posts')), @@ -492,15 +494,15 @@ function wp_edit_posts_query( $q = '_GET' ) { $post_status_q = ''; $post_status_label = _c('Posts|manage posts header'); - if ( isset($$q['post_status']) && in_array( $$q['post_status'], array_keys($post_stati) ) ) { - $post_status_label = $post_stati[$$q['post_status']][1]; - $post_status_q = '&post_status=' . $$q['post_status']; + if ( isset($q['post_status']) && in_array( $q['post_status'], array_keys($post_stati) ) ) { + $post_status_label = $post_stati[$q['post_status']][1]; + $post_status_q = '&post_status=' . $q['post_status']; } - if ( 'pending' === $$q['post_status'] ) { + if ( 'pending' === $q['post_status'] ) { $order = 'ASC'; $orderby = 'modified'; - } elseif ( 'draft' === $$q['post_status'] ) { + } elseif ( 'draft' === $q['post_status'] ) { $order = 'DESC'; $orderby = 'modified'; } else { diff --git a/wp-admin/js/edit-posts.js b/wp-admin/js/edit-posts.js index c85fba9..5241c4c 100644 --- a/wp-admin/js/edit-posts.js +++ b/wp-admin/js/edit-posts.js @@ -6,7 +6,7 @@ if ( document.location.href.match(/(\?|&)c=/) ) else delAfter = function() { list[0].wpList.add( extra.children(':eq(0)').remove().clone() ); - $('#get-extra-button').click(); + $('#get-extra-posts').submit(); } var addBefore = function ( settings ) { diff --git a/wp-includes/js/wp-lists.js b/wp-includes/js/wp-lists.js index edd48e3..d32356a 100644 --- a/wp-includes/js/wp-lists.js +++ b/wp-includes/js/wp-lists.js @@ -282,9 +282,10 @@ var wpList = { } if ( 'none' != s.addColor ) { + var b = e.css( 'background-color' ); + if ( b == 'transparent' ) { b = ''; } Fat.fade_element(e.attr('id'),null,700,s.addColor); setTimeout( function() { - var b = e.css( 'background-color' ); var g = e.css( 'background-color', '' ).css( 'background-color' ); if ( b != g ) { e.css( 'background-color', b ); } }, 705 ); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 1be5632..2e1365c 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -61,7 +61,7 @@ class WP_Scripts { 'delText' => __('Are you sure you want to delete this %thing%?') ) ); - $this->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('jquery'), '20070823' ); + $this->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('jquery'), '20071023' ); $this->localize( 'wp-lists', 'wpListL10n', array( 'url' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php' ) ); @@ -118,7 +118,7 @@ class WP_Scripts { $this->add( 'admin-categories', '/wp-admin/js/categories.js', array('wp-lists'), '20070823' ); $this->add( 'admin-custom-fields', '/wp-admin/js/custom-fields.js', array('wp-lists'), '20070823' ); $this->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists'), '20070822' ); - $this->add( 'admin-posts', '/wp-admin/js/edit-posts.js', array('wp-lists'), '20070823' ); + $this->add( 'admin-posts', '/wp-admin/js/edit-posts.js', array('wp-lists'), '20071023' ); $this->add( 'admin-users', '/wp-admin/js/users.js', array('wp-lists'), '20070823' ); $this->add( 'xfn', '/wp-admin/js/xfn.js', false, '3517' ); $this->add( 'upload', '/wp-admin/js/upload.js', array('jquery'), '20070518' ); diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 5c60ad4..fb40b2e 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1431,15 +1431,7 @@ function clean_term_cache($ids, $taxonomy = '') { * @return bool|array Empty array if $terms found, but not $taxonomy. False if nothing is in cache for $taxonomy and $id. */ function &get_object_term_cache($id, $taxonomy) { - $terms = wp_cache_get($id, 'object_terms'); - if ( false !== $terms ) { - if ( isset($terms[$taxonomy]) ) - return $terms[$taxonomy]; - else - return array(); - } - - return false; + return wp_cache_get($id, "{$taxonomy}_relationships"); } /** @@ -1467,28 +1459,42 @@ function update_object_term_cache($object_ids, $object_type) { $object_ids = array_map('intval', $object_ids); + $taxonomies = get_object_taxonomies($object_type); + $ids = array(); foreach ( (array) $object_ids as $id ) { - if ( false === wp_cache_get($id, 'object_terms') ) - $ids[] = $id; + foreach ( $taxonomies as $taxonomy ) { + if ( false === wp_cache_get($id, "{$taxonomy}_relationships") ) { + $ids[] = $id; + break; + } + } } if ( empty( $ids ) ) return false; - $terms = wp_get_object_terms($ids, get_object_taxonomies($object_type), 'fields=all_with_object_id'); + $terms = wp_get_object_terms($ids, $taxonomies, 'fields=all_with_object_id'); $object_terms = array(); foreach ( (array) $terms as $term ) $object_terms[$term->object_id][$term->taxonomy][$term->term_id] = $term; foreach ( $ids as $id ) { - if ( ! isset($object_terms[$id]) ) - $object_terms[$id] = array(); + foreach ( $taxonomies as $taxonomy ) { + if ( ! isset($object_terms[$id][$taxonomy]) ) { + if ( !isset($object_terms[$id]) ) + $object_terms[$id] = array(); + $object_terms[$id][$taxonomy] = array(); + } + } } - foreach ( $object_terms as $id => $value ) - wp_cache_set($id, $value, 'object_terms'); + foreach ( $object_terms as $id => $value ) { + foreach ( $value as $taxonomy => $terms ) { + wp_cache_set($id, $terms, "{$taxonomy}_relationships"); + } + } } /** |