Maybe it would be better to re-write the query like this?
SET @row_number = 0;
UPDATE $wpdb->posts SET menu_order = (
SELECT @row_number:=@row_number + 1
FROM (SELECT 1) tmp
ORDER BY menu_order ASC
)
WHERE post_type = '" . $object . "' AND post_status IN ('publish', 'pending', 'draft', 'private', 'future')
ORDER BY menu_order ASC
-
This reply was modified 3 years, 8 months ago by ampersand.
Hello and thank you for the quick response time.
Any chance to get a kind of JSON configuration file or PHP (like ACF does) which I can put in the theme directory so that I don’t have to export/import the settings every time the client creates a new website?