@@ 50-55 (lines=6) @@ | ||
47 | add_action( 'admin_bar_menu', array( $this, 'remove_filters' ), 0 ); |
|
48 | } |
|
49 | ||
50 | public function setup_filters() { |
|
51 | add_filter( 'the_content', array( $this, 'add_image_placeholders' ), 99 ); // run this later, so other content filters have run, including image_add_wh on WP.com |
|
52 | add_filter( 'post_thumbnail_html', array( $this, 'add_image_placeholders' ), 11 ); |
|
53 | add_filter( 'get_avatar', array( $this, 'add_image_placeholders' ), 11 ); |
|
54 | add_filter( 'wp_get_attachment_image_attributes', array( __CLASS__, 'process_image_attributes' ), PHP_INT_MAX ); |
|
55 | } |
|
56 | ||
57 | public function remove_filters() { |
|
58 | remove_filter( 'the_content', array( $this, 'add_image_placeholders' ), 99 ); |
|
@@ 57-62 (lines=6) @@ | ||
54 | add_filter( 'wp_get_attachment_image_attributes', array( __CLASS__, 'process_image_attributes' ), PHP_INT_MAX ); |
|
55 | } |
|
56 | ||
57 | public function remove_filters() { |
|
58 | remove_filter( 'the_content', array( $this, 'add_image_placeholders' ), 99 ); |
|
59 | remove_filter( 'post_thumbnail_html', array( $this, 'add_image_placeholders' ), 11 ); |
|
60 | remove_filter( 'get_avatar', array( $this, 'add_image_placeholders' ), 11 ); |
|
61 | remove_filter( 'wp_get_attachment_image_attributes', array( __CLASS__, 'process_image_attributes' ), PHP_INT_MAX ); |
|
62 | } |
|
63 | ||
64 | public function add_image_placeholders( $content ) { |
|
65 | // Don't lazyload for feeds, previews |