Duplicate post functionality & postmeta

I have a custom “most read” feature where a custom field is incremented every time a post is viewed. Since the data is stored as a custom field it gets duplicated when using the duplicate post option provided by Beaver Builder, which is a bad!

At the moment the only way I can see doing it is overriding the duplicate_post method in the class-fl-builder-model.php class, but wanted to check here first in case there’s a better way.

Is it possible to override this class directly in my child theme?

I have opened an internal issue to add a couple of actions that you can use to adjust the post meta after duplicating.

1 Like