WordPress.org

Ready to get started?Download WordPress

Forums

Postie
Filter Postie (3 posts)

  1. ColePhoenix1969
    Member
    Posted 3 months 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 3 months 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 3 months 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.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.