mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-27 18:16:08 +00:00
Don't flush rules for every post imported. see #7193
git-svn-id: http://svn.automattic.com/wordpress/trunk@9101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
65660bd565
commit
da50360c41
@ -120,6 +120,10 @@ if (isset($plugin_page)) {
|
|||||||
|
|
||||||
include(ABSPATH . 'wp-admin/admin-footer.php');
|
include(ABSPATH . 'wp-admin/admin-footer.php');
|
||||||
|
|
||||||
|
// Make sure rules are flushed
|
||||||
|
global $wp_rewrite;
|
||||||
|
$wp_rewrite->flush_rules();
|
||||||
|
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
do_action("load-$pagenow");
|
do_action("load-$pagenow");
|
||||||
|
@ -3112,8 +3112,11 @@ function _publish_post_hook($post_id) {
|
|||||||
function _save_post_hook($post_id, $post) {
|
function _save_post_hook($post_id, $post) {
|
||||||
if ( $post->post_type == 'page' ) {
|
if ( $post->post_type == 'page' ) {
|
||||||
clean_page_cache($post_id);
|
clean_page_cache($post_id);
|
||||||
|
// Avoid flushing rules for every post during import.
|
||||||
|
if ( !defined('WP_IMPORTING') ) {
|
||||||
global $wp_rewrite;
|
global $wp_rewrite;
|
||||||
$wp_rewrite->flush_rules();
|
$wp_rewrite->flush_rules();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
clean_post_cache($post_id);
|
clean_post_cache($post_id);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user