Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter handyandywilson

    (@handyandywilson)

    Also is there a way to prevent a post from being generated as I am looking to solely transfer the email content to buddypress activity however in doing so an additional post is created.

    Cheers!

    Thread Starter handyandywilson

    (@handyandywilson)

    cool. In /wp-content/ directory Wayne.

    Thread Starter handyandywilson

    (@handyandywilson)

    OK so if I directly edit the plugin files (I know, I know) and add

    global $bp;
        bp_activity_post_update(array('content' =>$content, 'user_id' => $postAuthorDetails['user_ID']));

    to the end of

    $details = array(
            'post_author' => $poster,
            'comment_author' => $postAuthorDetails['author'],
            'comment_author_url' => $postAuthorDetails['comment_author_url'],
            'user_ID' => $postAuthorDetails['user_ID'],
            'email_author' => $postAuthorDetails['email'],
            'post_date' => $post_date,
            'post_date_gmt' => $post_date_gmt,
            'post_content' => $content,
            'post_title' => $subject,
            'post_type' => $post_type, /* Added by Raam Dev <[email protected]> */
            'ping_status' => get_option('default_ping_status'),
            'post_category' => $post_categories,
            'tags_input' => $post_tags,
            'comment_status' => $comment_status,
            'post_name' => sanitize_title($subject),
            'post_excerpt' => $post_excerpt,
            'ID' => $id,
            'customImages' => $customImages,
            'post_status' => $post_status
        );

    in postie-functions.php, it works a treat.

    Now how can I hook into this properly? (im not a developer) Any help appreciated ??

    Cheers,

    Andrew

    Thread Starter handyandywilson

    (@handyandywilson)

    As above

    <?php function my_postie_post_function($post) {
    $content = $post[‘post_content’];
    $user_ID = $post[‘user_ID’];
    $content = sanitize_text_field($content);
    bp_activity_post_update(array('content' =>$content, 'user_id' => $user_ID));
    }
     add_filter('postie_post_before',’my_postie_post_function’); ?>
    Thread Starter handyandywilson

    (@handyandywilson)

    Thanks Wayne, in filterPostie.php as recommended. Any ideas?

    Thread Starter handyandywilson

    (@handyandywilson)

    Here’s my first attempt using Postie’s recommendations: https://postieplugin.com/extending/

    function my_postie_post_function($post) {
    $content = $post[‘post_content’];
    $user_ID = $post[‘user_ID’];
    $content = sanitize_text_field($content);
    bp_activity_post_update(array('content' =>$content, 'user_id' => $user_ID));
    exit();
    }
     add_filter('postie_post_before',’my_postie_post_function’);

    … but hit a bug. When checking for mail postie outputs this error

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘’my_postie_post_function’’ not found or invalid function name in domain.com/wp-includes/plugin.php on line 213

    even if I output this function with nothing in it I still get this error. Any advice?

    Cheers,

    Andrew

    Ditto that. I can post to my wall but not my pages. I have all admin rights on wp and all privileges given to wordpress on facebook.

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