WordPress.org

Ready to get started?Download WordPress

Forums

Postie
[resolved] Multiple Categories post OK but remain in Title (5 posts)

  1. motioneditor
    Member
    Posted 1 year ago #

    I'm using Postie 1.4.3 (tried 1.4.4 but could never get it to work) and it's ideal in all respects - except one.
    When posting using the Category facility (using [catagory] system in Title) if multiple catagories are used [Cat1][Cat2]Title then the resulting post will be assigned to the correct categories, but the Title will appear as [Cat2]Title - i.e any categories above 1 won't be deleted from the Title.
    any suggestions?

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

  2. ssomsen
    Member
    Posted 1 year ago #

    In postie-functions.php, change the php regular expression code. Change:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser. ]

    function GetPostCategories(&$subject, $defaultCategory) {
        global $wpdb;
        $post_categories = array();
        $matches = array();
        //try and determine category
        if ( preg_match('/(.+): (.*)/', $subject, $matches))  {
            $subject = trim($matches[2]);
            $matches[1] = array($matches[1]);
        }
        else if (preg_match_all('/\[(.[^\[]*)\]/', $subject, $matches)) {
            <strong>preg_match("/](.[^\[]*)$/",$subject,$subject_matches);</strong>
            $subject = trim($subject_matches[1]);
        }

    Into:

    function GetPostCategories(&$subject, $defaultCategory) {
        global $wpdb;
        $post_categories = array();
        $matches = array();
        //try and determine category
        if ( preg_match('/(.+): (.*)/', $subject, $matches))  {
            $subject = trim($matches[2]);
            $matches[1] = array($matches[1]);
        }
        else if (preg_match_all('/\[(.[^\[]*)\]/', $subject, $matches)) {
    <strong>        preg_match("/]([^\[]*)$/",$subject,$subject_matches);</strong>
            $subject = trim($subject_matches[1]);
        }
  3. motioneditor
    Member
    Posted 1 year ago #

    Many thanks - that seems to have solved the problem

  4. Wayne Allen
    Member
    Plugin Author

    Posted 1 year ago #

    >tried 1.4.4 but could never get it to work

    Could you elaborate? I'm working on the next release.

  5. motioneditor
    Member
    Posted 1 year ago #

    The problem was that e-mails were being rejected. I have to admit I cannot remember the exact messages that were being produced, but I formed the opinion that it was something to do with some added security that had gone into 1.4.4. I did find some forum suggestions for modifying the code, but none of them seemed to have any effect. I'm running a news blog for the technical end of film & TV, and almost all my blog posts are of press releases sent via email, so having a working Postie is "mission critical", so I decided not to spend any more time trying to track down the problem
    Sorry to not be more help.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.