Create custom module of existing one issue


I have made a duplicate of the 'plugins/bb-plugin/modules/rich-text' folder and pasted it into 'themes/bb-theme-child/fl-builder/modules/rich-text'.

Then i added the following ‘stripslahes’ codesnippet into ‘themes/bb-theme-child/fl-builder/modules/rich-text/includes/frontend.php’.

<div class="fl-rich-text" >
    <?php echo stripslashes_deep($settings->text); ?>

The stripslashes function doesn’t work then.

But when i paste the exact same snippet directly in the frontend.php file of the rich-text module in the plugins folder of beaver builder the stripslashes function work perfectly. Could you help me out on this one, do you have an idea, since i want to keep the bb plugin updatable.

ps. i also tried this from within the bb parent theme, but this didn’t work either.

Thanks in advance,
kind regards,

Hi Jorrit,

Can you provide an example of some content that stripslashes_deep should be working on so I can test this?


Hello, i have found the solution.

Upon blank Wordpress installation i renamed the default “wp-content” folder to “app” with the Ithemes Security plugin. (I also changed default database prefixes (‘wp_’) to (fsdfsdaw2f_’). But this has no consequences i think)

I have done a ‘search all’ within Sublimetext through the bb-plugin folder and found out that the file ‘\plugins\bb-plugin\classes\FLBuilderModule.php’ uses a hardcoded wp-content link:

  145          $this->editor_export    = isset($params['editor_export']) ? $params['editor_export'] : true;
  147:         if(stristr($dir_path, 'wp-content/themes')) {
  148:             $parts     = explode('/wp-content', str_ireplace($_SERVER['DOCUMENT_ROOT'], '', $dir_path));
  149              $folder    = array_shift($parts);
  150              $this->url = str_ireplace($_SERVER['DOCUMENT_ROOT'] . $folder, site_url(), $dir_path) . '/';

When i change ‘wp-content’ to ‘app’ in above code snippet in the FLBuilderModule.php it works just fine. But this way i cannot upgrade the plugin in the future.

Am i forced to use the default ‘wp-content’ folder when using de Beaver plugin? Is there a way to fix this? I would really like to use my own folder name instead of the default ‘wp-content’ name. (i.e. for security reasons)

By the way: The stripslashes_deep was needed to strip insertion of backslash (/) on images and inline font-sizes in the text-editor when using live reloading with my custom module. (hit the tab ‘block and then hit ‘width’ in my example if you want to see what i mean)’. If stripslashes is deactivated the image and font-sizes disappear upon toggling the width dropwdown.

I will send you my custom rich-text module.

Thanks again for the great plugin, theme and service, i like it very much!

Looking forward to hearing from you,

[Content Hidden]

Hey Jorrit,

I wasn’t aware that it’s possible to change the wp-content directory name. It looks like we should be using the content_url function to make sure the builder works with that. I’ve made a note to look into that for the next version of the builder.