WordPress.org

Plugin Directory

Changeset 632068


Ignore:
Timestamp:
11/30/12 01:54:19 (17 months ago)
Author:
ethitter
Message:

Jetpack Photon update

Pass all images retrieved from the local WP instance to Photon when not in the admin context.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jetpack/trunk/modules/photon.php

    r632065 r632068  
    5454        add_filter( 'the_content', array( $this, 'filter_the_content' ), 999999 ); 
    5555 
    56         // Featured images aka post thumbnails 
    57         add_action( 'begin_fetch_post_thumbnail_html', array( $this, 'action_begin_fetch_post_thumbnail_html' ) ); 
    58         add_action( 'end_fetch_post_thumbnail_html', array( $this, 'action_end_fetch_post_thumbnail_html' ) ); 
     56        // Core image retrieval 
     57        add_filter( 'image_downsize', array( $this, 'filter_image_downsize' ), 10, 3 ); 
    5958 
    6059        // og:image URL 
     
    265264 
    266265    /** 
    267      ** POST THUMBNAIL FUNCTIONS 
     266     ** CORE IMAGE RETRIEVAL 
    268267     **/ 
    269  
    270     /** 
    271      * Apply Photon to WP image retrieval functions for post thumbnails 
    272      * 
    273      * @uses add_filter 
    274      * @action begin_fetch_post_thumbnail_html 
    275      * @return null 
    276      */ 
    277     public function action_begin_fetch_post_thumbnail_html() { 
    278         add_filter( 'image_downsize', array( $this, 'filter_image_downsize' ), 10, 3 ); 
    279     } 
    280  
    281     /** 
    282      * Remove Photon from WP image functions when post thumbnail processing is finished 
    283      * 
    284      * @uses remove_filter 
    285      * @action end_fetch_post_thumbnail_html 
    286      * @return null 
    287      */ 
    288     public function action_end_fetch_post_thumbnail_html() { 
    289         remove_filter( 'image_downsize', array( $this, 'filter_image_downsize' ), 10, 3 ); 
    290     } 
    291268 
    292269    /** 
Note: See TracChangeset for help on using the changeset viewer.