Bug with ACF Blocks
-
Hi,
Thanks for the great plugin. I have found an issue when copying pages or posts with ACF Block content. When this is the case, some blocks copied fine, but those with HTML or characters that needed escaping were not copied properly as characters were not escaped with slashes. i’ve come up with a temporary fix, but would really appreciate if you could look into this?
Within admin/admin.php
// !fix to enable copying of html for ACF blocks private function get_post_content($post){ if($this->parametrs["copy_content"]=="1"){ $content = $post->post_content; // check if it's html if($content != strip_tags($content)) { // it is so escape html slashes $content = addslashes($content); } return $content; } return ""; }
Steps to recreate would be to create an ACF block with a WYSIWYG field and adds some HTML copy. Then add this block to a page, add some content and save it. Then duplicate the page and you will see the block is not copied properly and the block content is invalid due to characters not being escaped.
Cheers!
- The topic ‘Bug with ACF Blocks’ is closed to new replies.