handyandywilson
Forum Replies Created
-
Forum: Plugins
In reply to: [Postie] How to post to buddypress activity?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!
Forum: Plugins
In reply to: [Postie] How to post to buddypress activity?cool. In /wp-content/ directory Wayne.
Forum: Plugins
In reply to: [Postie] How to post to buddypress activity?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
Forum: Plugins
In reply to: [Postie] How to post to buddypress activity?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’); ?>
Forum: Plugins
In reply to: [Postie] How to post to buddypress activity?Thanks Wayne, in filterPostie.php as recommended. Any ideas?
Forum: Plugins
In reply to: [Postie] How to post to buddypress activity?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.