WordPress.org

Forums

Postie
[resolved] Filter Postie (3 posts)

  1. ColePhoenix1969
    Member
    Posted 1 year ago #

    Hey: This is probably an easy questions for the coders, but for me is very difficult.

    I am trying to use the filter postie to strip out unwanted parts of the subject from the email. So, for example, Let's say the subject of the email is always the same (from a list) and the subject is "Same Thing Here Needs Stripped This Is The Actual Subject"

    So, how would I remove "Same Thing Here Needs Stripped"?

    This is what I have in filter_postie, but it doesn't seem to work....

    function filter_title($post) {
        //this function strips "(Same Thing Here Needs Stripped)" from the title (subject)
    	  if (stristr($post, 'Same Thing Here Needs Stripped'))
            return get_option(" ");
        return $post;
    }

    http://wordpress.org/plugins/postie/

  2. Wayne Allen
    Member
    Plugin Author

    Posted 1 year ago #

    $post is an array of different elements see http://codex.wordpress.org/Function_Reference/wp_insert_post#Parameters

    You need to inspect $post['post_title']

    if (stristr($post['post_title'], 'Same Thing Here Needs Stripped')) {
        $post['post_title'] = substr($post['post_title'], 31);
    }
    return $post;
  3. ColePhoenix1969
    Member
    Posted 1 year ago #

    Thanks so much! It looks like that strips the first 31 characters from the post title, the post URL in WordPress still says "Something Here Needs Stripped", but I'm not too worried about that.

    Thanks again.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Postie
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.