Skip to content

Commit

Permalink
Disable on POST
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedmonkey committed Dec 14, 2015
1 parent 709903d commit 1bb7c28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions echo-js-lazy-load.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,13 @@ public function is_lazy_load_enabled() {
$lazy_load_enabled = false;
}

// Is post, let's not bother
if ( ! empty( $GLOBALS['HTTP_RAW_POST_DATA'] ) || ! empty( $_POST ) ||
( isset( $_SERVER['REQUEST_METHOD'] ) && 'POST' === $_SERVER['REQUEST_METHOD'] ) ) {
$context = 'post';
$lazy_load_enabled = false;
}

/**
* Is echo js enabled, by context
*
Expand Down
2 changes: 1 addition & 1 deletion wpcom-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

add_filter( 'echo_js_lazy_load_enabled', 'wpcom_vip_disable_lazyload_on_mobile' );

function wpcom_vip_disable_cool_lazy_load_on_mobile( $enabled ) {
function wpcom_vip_disable_lazyload_on_mobile( $enabled ) {
if ( function_exists( 'jetpack_is_mobile' ) && jetpack_is_mobile() )
$enabled = false;

Expand Down

0 comments on commit 1bb7c28

Please sign in to comment.