to search and replace a string before saving a post i’m using the wordpress filter ‘content_save_pre’.
It works fine in the Wordpress editor, but when i am editing a page with BB, the content isn’t replaced.
Or should i use a BB hook like add_action( ‘fl_builder_before_save_layout’)?
I need a way to use this search and replace behavior with the wordpress filter in BB. So i thought I could use the fl_builder_before_save_layout action, but it doesn’t work.
But why do I need this?
I use a shortcode to link pages like [doPageLink id=1] and Wordpress expands this to https://link/to/site.
But the BB Text Editor module add an additional http:// before the shortcode after pasting the shortcode into the link modal. After saving the post the link is broken, because it looks like http://https://link/to/site. So I want to search and replace it to a working URL.
Ok, of course you can correct the URL before in text-mode, but not every user remember it
If there is a way to sanitize the URL it would be fine