Code Duplication    Length = 8-8 lines in 2 locations

modules/lazy-images/lazy-images.php 2 locations

@@ 53-60 (lines=8) @@
50
		add_action( 'wp_head', array( $this, 'add_nojs_fallback' ) );
51
	}
52
53
	public function setup_filters() {
54
		add_filter( 'the_content', array( $this, 'add_image_placeholders' ), PHP_INT_MAX ); // run this later, so other content filters have run, including image_add_wh on WP.com
55
		add_filter( 'post_thumbnail_html', array( $this, 'add_image_placeholders' ), PHP_INT_MAX );
56
		add_filter( 'get_avatar', array( $this, 'add_image_placeholders' ), PHP_INT_MAX );
57
		add_filter( 'widget_text', array( $this, 'add_image_placeholders' ), PHP_INT_MAX );
58
		add_filter( 'get_image_tag', array( $this, 'add_image_placeholders' ), PHP_INT_MAX);
59
		add_filter( 'wp_get_attachment_image_attributes', array( __CLASS__, 'process_image_attributes' ), PHP_INT_MAX );
60
	}
61
62
	public function remove_filters() {
63
		remove_filter( 'the_content', array( $this, 'add_image_placeholders' ), PHP_INT_MAX );
@@ 62-69 (lines=8) @@
59
		add_filter( 'wp_get_attachment_image_attributes', array( __CLASS__, 'process_image_attributes' ), PHP_INT_MAX );
60
	}
61
62
	public function remove_filters() {
63
		remove_filter( 'the_content', array( $this, 'add_image_placeholders' ), PHP_INT_MAX );
64
		remove_filter( 'post_thumbnail_html', array( $this, 'add_image_placeholders' ), PHP_INT_MAX );
65
		remove_filter( 'get_avatar', array( $this, 'add_image_placeholders' ), PHP_INT_MAX );
66
		remove_filter( 'widget_text', array( $this, 'add_image_placeholders' ), PHP_INT_MAX );
67
		remove_filter( 'get_image_tag', array( $this, 'add_image_placeholders' ), PHP_INT_MAX);
68
		remove_filter( 'wp_get_attachment_image_attributes', array( __CLASS__, 'process_image_attributes' ), PHP_INT_MAX );
69
	}
70
71
	/**
72
	 * Ensure that our lazy image attributes are not filtered out of image tags.