Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added fix for the update bug.

  • Loading branch information...
commit 9120df5edbbf92e4044f4427b8f47af5ab8b897c 1 parent f36e422
Faison Zutavern authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 reorder-posts-within-categories.php
8 reorder-posts-within-categories.php
View
@@ -180,16 +180,18 @@ public function savePost_callBack($post_id)
if($taxonomie->hierarchical == 1 && is_array($orderedSettingOptions) && in_array($taxonomie->name, $orderedSettingOptions)){
//echo "<li>".$taxonomie->name."</li>";
$terms = get_terms( $taxonomie->name );
+
+ $terms_of_the_post = wp_get_post_terms( $post_id, $taxonomie->name );
+ $term_ids_of_the_post = wp_list_pluck( $terms_of_the_post, 'term_id' );
//echo "<pre>";
//print_r($terms);
//echo "</pre>";
if (count($terms) > 0){
- //echo "<ul>";
+ //echo "<ul>";
foreach ($terms as $term){
- $terms_of_the_post = wp_get_post_terms( $post_id, $taxonomie->name );
//echo "<li>";
//echo "<p>--" . $term->name . " (" . $term->term_id .")</p>";
- if(in_array($term, $terms_of_the_post))
+ if(in_array($term->term_id, $term_ids_of_the_post))
{
$trieEnCoursEnDb = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $table_name WHERE category_id=%d", $term->term_id) );
if($trieEnCoursEnDb != 0)
Please sign in to comment.
Something went wrong with that request. Please try again.