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

BeaverBuilderCompat   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A beaverbuilder_refresh() 0 5 2
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