Sticky posts issues when Redis cache is full (cont’d)

Ref: https://projectdmc.org/support/topic/sticky-posts-issues-when-redis-cache-is-full/#post-16851128

This code:

wp_update_post( array( 'ID' => $post->ID, 'menu_order' => $start), false, false );

is rather slow when updating dozens of posts.

@tillkruess is it safe to use this code instead:

$wpdb->update($wpdb->posts, array( 'menu_order' => $start ), array( 'ID' => $post->ID) );
clean_post_cache($post->ID);

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer