Completed
Push — update/search/widget-author-ag... ( e3f86a...0871f4 )
by Alex
66:17 queued 57:31
created

BeaverBuilderCompat::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Beaverbuilder Compatibility.
4
 */
5
class BeaverBuilderCompat {
6
7
	function __construct() {
8
		add_action( 'init', array( $this, 'beaverbuilder_refresh' ) );
9
	}
10
11
	/**
12
	 * If masterbar module is active force BeaverBuilder to refresh when publishing a layout.
13
	 */
14
	function beaverbuilder_refresh() {
15
		if ( Jetpack::is_module_active( 'masterbar' ) ) {
16
			add_filter( 'fl_builder_should_refresh_on_publish', '__return_true' );
17
		}
18
	}
19
}
20
new BeaverBuilderCompat();
21