PluginProbe
LoftLoader / 2.3.3
LoftLoader v2.3.3
trunk 1.0.0 1.0.1 1.0.2 2.0.0 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.3 2.3.1 2.3.2 2.3.3 All 34 releases
← All changes | inc/class-loftloader-front.php +5 -7 2.32.3.3 View file →
@@ -32,9 +32,8 @@
32 32 public function init_cache() {
33 33 // Only for front view
34 34 if ( ! is_admin() ) {
35 35 add_action( 'wp_head', array( $this, 'start_cache' ) );
36 - add_action( 'wp_footer', array( $this, 'modify_html' ), 99999 );
37 36 }
38 37 }
39 38 /**
40 39 * Start cache for outputing
@@ -39,9 +38,9 @@
39 38 /**
40 39 * Start cache for outputing
41 40 */
42 41 public function start_cache() {
43 - ob_start();
42 + ob_start( array( $this, 'modify_html' ) );
44 43 }
45 44 /**
46 45 * Will be called when flush cache
47 46 *
@@ -47,14 +46,13 @@
47 46 *
48 47 * @param string cached string
49 48 * @return string modified cached string
50 49 */
51 - public function modify_html() {
52 - $html = ob_get_clean();
50 + public function modify_html( $html ) {
53 51 if ( $this->site_header_loaded && $this->site_footer_loaded ) {
54 - echo apply_filters( 'loftloader_modify_html', $html );
52 + return apply_filters( 'loftloader_modify_html', $html );
55 53 } else {
56 - echo $html;
54 + return $html;
57 55 }
58 56 }
59 57 /**
60 58 * @description get the plugin settings
@@ -300,9 +298,9 @@
300 298 public function set_footer_loaded() {
301 299 $this->site_footer_loaded = true;
302 300 }
303 301 /**
304 - * Not show loader in builder and theme customizer
302 + * Not show loader in builder and theme customizer
305 303 */
306 304 protected function test_builder() {
307 305 if ( defined( 'ELEMENTOR_PATH' ) && isset( $_GET['elementor-preview'] ) && ! empty( sanitize_text_field( wp_unslash( $_GET['elementor-preview'] ) ) ) ) {
308 306 return true;