Skip to content

Commit 2a17f30

Browse files
committed
feat: adds full compatibility with Beaver Builder, processing images from the generated css
1 parent 7a47827 commit 2a17f30

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/**
4+
* Class Optml_beaver_builder.
5+
*
6+
* @reason Beaver builder offload the CSS in a separate file, which we access and process the image urls.
7+
*/
8+
class Optml_beaver_builder extends Optml_compatibility {
9+
10+
11+
/**
12+
* Should we load the integration logic.
13+
*
14+
* @return bool Should we load.
15+
*/
16+
function should_load() {
17+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
18+
19+
return is_plugin_active( 'bb-plugin/fl-builder.php' ) || is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' );
20+
}
21+
22+
/**
23+
* Register integration details.
24+
*/
25+
public function register() {
26+
add_filter( 'fl_builder_render_css', [ Optml_Main::instance()->manager, 'replace_content' ], PHP_INT_MAX, 1 );
27+
}
28+
29+
}

inc/manager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ final class Optml_Manager {
5757
'shortcode_ultimate',
5858
'foogallery',
5959
'envira',
60+
'beaver_builder',
6061
'revslider',
6162
'woocommerce',
6263
);

themeisle-hash.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"optimole-wp.php":"f950ffdf356d41cad77f24a4fed3c1e1"}
1+
{"optimole-wp.php":"405e35cd1cecc377bd06aa40d3bd3593"}

0 commit comments

Comments
 (0)