Skip to content

Commit

Permalink
feat: adds full compatibility with Beaver Builder, processing images …
Browse files Browse the repository at this point in the history
…from the generated css
  • Loading branch information
selul committed Mar 19, 2019
1 parent 7a47827 commit 2a17f30
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
29 changes: 29 additions & 0 deletions inc/compatibilities/beaver_builder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/**
* Class Optml_beaver_builder.
*
* @reason Beaver builder offload the CSS in a separate file, which we access and process the image urls.
*/
class Optml_beaver_builder extends Optml_compatibility {


/**
* Should we load the integration logic.
*
* @return bool Should we load.
*/
function should_load() {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

return is_plugin_active( 'bb-plugin/fl-builder.php' ) || is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' );
}

/**
* Register integration details.
*/
public function register() {
add_filter( 'fl_builder_render_css', [ Optml_Main::instance()->manager, 'replace_content' ], PHP_INT_MAX, 1 );
}

}
1 change: 1 addition & 0 deletions inc/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ final class Optml_Manager {
'shortcode_ultimate',
'foogallery',
'envira',
'beaver_builder',
'revslider',
'woocommerce',
);
Expand Down
2 changes: 1 addition & 1 deletion themeisle-hash.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"optimole-wp.php":"f950ffdf356d41cad77f24a4fed3c1e1"}
{"optimole-wp.php":"405e35cd1cecc377bd06aa40d3bd3593"}

0 comments on commit 2a17f30

Please sign in to comment.