Klavyio woocommerce – Could not insert post

The last updates to WordPress core may issue theĀ  “Could not insert post to database” error while using the klavyio plugin for wordpress. The fix is pretty simple and it’s needed because of the length constraints of the password field:

 

add_filter('woocommerce_klaviyo_new_cart_data', function($args) {
     $args['post_password'] = uniqid( 'klvct_' );
     return $args;
});

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>