diff --git a/includes/posts-save.php b/includes/posts-save.php new file mode 100644 index 0000000..50ea7d6 --- /dev/null +++ b/includes/posts-save.php @@ -0,0 +1,17 @@ + $post_type, + 'posts_per_page' => -1, + 'orderby' => 'date', + 'order' => 'ASC', + )); + $numerotation = 0; + while ($query->have_posts()) { + $query->the_post(); + $numerotation++; + update_post_meta(get_the_ID(), 'post_numerotation', $numerotation); + } +} + + function hasPostTypeNumerotation($post_type) { switch ($post_type) {