WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Multiple Categories post OK but remain in Title

[Resolved] Multiple Categories post OK but remain in Title

  • 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/

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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]);
        }

    Many thanks – that seems to have solved the problem

    Plugin Author Wayne Allen

    @wayneallen-1

    >tried 1.4.4 but could never get it to work

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

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Multiple Categories post OK but remain in Title’ is closed to new replies.