WordPress.org

Plugin Directory

Changeset 623129


Ignore:
Timestamp:
11/09/12 18:30:15 (18 months ago)
Author:
dllh
Message:

Posterous Importer: Fire a hook and a function for setting the url_remap array so that it can be hooked into to do more fun stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • posterous-importer/branches/v2api/posterous.php

    r623061 r623129  
    6969        add_action( 'posterous_handle_bad_response', array( $this, 'handle_bad_response' ), 10, 2 ); 
    7070        add_action( 'posterous_api_sleep', array( $this, 'api_sleep' ) ); 
     71        add_action( 'posterous_store_url_remap', array( $this, 'store_url_remap' ), 10, 3 ); 
    7172 
    7273        if ( isset( $_GET['import'] ) && 'posterous' == $_GET['import'] ) { 
     
    559560            foreach ( $attachment->thumbs as $thumb ) { 
    560561                if ( isset( $sized[0] ) ) { 
    561                     $this->url_remap[ $thumb ] = preg_match( '/scaled\.?500\./', $thumb ) ? $sized[0] : $attachment_url; 
     562                    $full = preg_match( '/scaled\.?500\./', $thumb ) ? $sized[0] : $attachment_url; 
     563                    do_action( 'posterous_store_url_remap', $post->ID, $thumb, $full ); 
    562564                } 
    563565            } 
     
    619621            foreach ( $attachment->thumbs as $thumb ) { 
    620622                if ( isset( $sized[0] ) ) { 
    621                     $this->url_remap[ $thumb ] = preg_match( '/scaled\.?500\./', $thumb ) ? $sized[0] : $attachment_url; 
     623                    $full = preg_match( '/scaled\.?500\./', $thumb ) ? $sized[0] : $attachment_url; 
     624                    do_action( 'posterous_store_url_remap', $post->ID, $thumb, $full ); 
    622625                } 
    623626            } 
     
    12441247    } 
    12451248 
     1249    function store_url_remap( $post_id, $thumb, $full ) { 
     1250        $this->url_remap[ $thumb ] = $full; 
     1251    } 
    12461252} 
    12471253} 
Note: See TracChangeset for help on using the changeset viewer.