Skip to content

Commit

Permalink
use only clean_post_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
herewithme committed Jun 25, 2013
1 parent c8635f2 commit 89ee680
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
6 changes: 1 addition & 5 deletions inc/class.admin.autocomplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,7 @@ public static function save_post( $post_id = 0, $object = null ) {
wp_set_object_terms( $post_id, $tags, 'post_tag' );

// Clean cache
if ( 'page' == $object->post_type ) {
clean_page_cache($post_id);
} else {
clean_post_cache($post_id);
}
clean_post_cache($post_id);

return true;
}
Expand Down
6 changes: 1 addition & 5 deletions inc/class.admin.mass.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ public static function checkFormMassEdit() {
$counter++;

// Clean cache
if ( SimpleTags_Admin::$post_type == 'page' ) {
clean_page_cache($object_id);
} else {
clean_post_cache($object_id);
}
clean_post_cache($object_id);
}

add_settings_error( __CLASS__, __CLASS__, sprintf(__('%1$s %2$s(s) terms updated with success !', 'simpletags'), (int) $counter, strtolower(SimpleTags_Admin::$post_type_name) ), 'updated' );
Expand Down
12 changes: 2 additions & 10 deletions inc/class.client.autoterms.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ public static function save_post( $post_id = null, $object = null ) {
}

if ( $flag == true ) { // Clean cache ?
if ( isset($object->post_type) && $object->post_type == 'page' ) {
clean_page_cache($post_id);
} else {
clean_post_cache($post_id);
}
clean_post_cache($post_id);
}

return true;
Expand Down Expand Up @@ -153,11 +149,7 @@ public static function auto_terms_post( $object, $taxonomy = 'post_tag', $option
wp_set_object_terms( $object->ID, $terms_to_add, $taxonomy, true );

// Clean cache
if ( isset($object->post_type) && $object->post_type = 'page' ) {
clean_page_cache($object->ID);
} else {
clean_post_cache($object->ID);
}
clean_post_cache($object->ID);

return true;
}
Expand Down

0 comments on commit 89ee680

Please sign in to comment.