Wordpress hooks not working in BB?


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’)?

Thanks for your help :smiley:

What are you trying to do here? content_save_pre is a filter where fl_builder_before_save_layout is an action, the two are very different.

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? :crazy_face:
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 :face_with_symbols_over_mouth:

If there is a way to sanitize the URL it would be fine :smiley:

what does your shortcode code look like? Im not sure you are supposed to add shortcodes there.

This is my shortcode code, thank you for your help in advance :slightly_smiling_face:

function my_permalink_shortcode($atts) {

      $id = intval($atts['id']);
      if ($id <= 0) { return; }

      $url = get_permalink($id);
      if ($url == '') { return; }

      $link = ($atts['link'] == '1') ? true : false;
      $title = (trim($atts['title']) == '') ? get_the_title($id) : $atts['title'];

      if ($link) {
          return '<a href="'.$url.'">'.$title.'</a>'; 
      } else {
          return $url;
  add_shortcode('doPageLink', 'my_permalink_shortcode');

Does anyone have any suggestions? :slightly_smiling_face: