• Resolved hareln

    (@hareln)


    Hi,

    thanks for the plugin!

    I use “Postie” plugin to upload post via e-mail. with postie I can set that the first picture I add in the email will be the featured image.
    but, if I active your plugin – the default image is automatically the featured image.

    Do you have a solution? I want use both these plugins.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jan-Willem

    (@janwoostendorp)

    It was some digging but I think I found the solution:
    The following code you can put in your theme’s functions.php
    I have not tested this but it should work.
    Please let me know how it goes.

    
    /**
     * Never fetch the DFI image while doing Postie mail scan
     */
    function dfi_postie_pauze( $mimeDecodedEmail ) {
    	add_filter( 'dfi_thumbnail_id', '__return_null', 100 );
    
    	return $mimeDecodedEmail;
    }
    add_filter( 'postie_post_pre', 'dfi_postie_pauze' );
    
    /**
     * When Postie is done restore default DFI behavior
     */
    function dfi_postie_play( $details ) {
    	remove_filter( 'dfi_thumbnail_id', '__return_null', 100 );
    
    	return $details;
    }
    add_filter( 'postie_post_pre', 'dfi_postie_play' );
    
    Thread Starter hareln

    (@hareln)

    Hi,

    First, thank for your answer.

    I pasted this code but I think it’s didn’t work. The default picture is still the featured image and the picture that I uploaded via postie just include in post.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Did you try a new upload?
    I should have specified. This should only work on new posts.
    There is no way to fix older posts.

    Thread Starter hareln

    (@hareln)

    Yes. I tried with a new upload. and it’s didn’t work.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    
    <?php
    
    /**
     * Never fetch the DFI image while doing Postie mail scan
     */
    function dfi_postie_pauze( $mimeDecodedEmail ) {
    	add_filter( 'dfi_thumbnail_id', '__return_zero');
    
    	return $mimeDecodedEmail;
    }
    add_action( 'postie_session_start', 'dfi_postie_pauze' );
    
    /**
     * When Postie is done restore default DFI behavior
     */
    function dfi_postie_play( $details ) {
    	remove_filter( 'dfi_thumbnail_id', '__return_zero' );
    
    	return $details;
    }
    add_action( 'postie_session_end', 'dfi_postie_play' );
    

    New attempt. Again let me know if a new email post works or not.

    Thread Starter hareln

    (@hareln)

    it’s work! thanks a lot!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Integration with Postie’ is closed to new replies.