• Resolved cheeseburglar

    (@cheeseburglar)


    I’m trying to find a way to simply upload images to the media library in my wordpress without having Postie create a post for me.

    I tried using the wordpress ios app and the shortcuts / wordpress action to upload images to my wordpress but that’s been super flaky. Postie, by far, has been the most reliable way to get images uploaded to wordpress but I just don’t need to have it create a post for me at this time.

    Any help would be appreciated!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Wayne Allen

    (@wayneallen-1)

    The easiest way would be to create a Postie AddOn that returns null from the postie_post_before filter. See http://postieplugin.com/postie_post_before/

    add_filter(‘postie_post_before’, ‘my_postie_post_before’);

    function my_postie_post_before($post) {
    return null;
    }

    Thread Starter cheeseburglar

    (@cheeseburglar)

    I’ve never added an addon let alone create one. Would I be adding filterPostie.php to wp-content with the code above like mentioned here?
    http://postieplugin.com/extending/

    Thank you!

    Plugin Author Wayne Allen

    (@wayneallen-1)

    Yes, just like this:

    <?php 
    add_filter(‘postie_post_before’, ‘my_postie_post_before’);
    
    function my_postie_post_before($post) {
    return null;
    }
    
    Thread Starter cheeseburglar

    (@cheeseburglar)

    I’ve created the filterPostie.php file with the following code and placed it in wp-contents, but unfortunately, when I email images, it still publishes.

    <?php
    add_filter(‘postie_post_before’, ‘my_postie_post_before’);
    
    function my_postie_post_before($post) {
    return null;
    }
    ?>

    Is there another step I could be missing?

    Thank you!

    Plugin Author Wayne Allen

    (@wayneallen-1)

    try changing the curly quotes to straight quotes:

    
    <?php
    add_filter('postie_post_before', 'my_postie_post_before');
    
    function my_postie_post_before($post) {
        return null;
    }
    
    Thread Starter cheeseburglar

    (@cheeseburglar)

    Ahh! That was it. I never would have noticed that!

    Now what I see happening is that when the image is emailed, the post is still created but is placed in the trash instead of nothing being created at all.

    Plugin Author Wayne Allen

    (@wayneallen-1)

    Yes, that is the expected behavior.

    Thread Starter cheeseburglar

    (@cheeseburglar)

    Is this any different from setting the default post status to “trash”?

    Plugin Author Wayne Allen

    (@wayneallen-1)

    That would likely work as well.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Upload images only. Do not create a post.’ is closed to new replies.