Custom-fields in Budypress Activity-content
Author | Posts |
---|---|
July 9, 2013 at 9:38 pm 5791 | |
Hi @Tareq,
For insert custom-fields in activity content I must need use this filter:
This function I tested with wordpress, but with WPUF not work. Aparently is because the plugin not trigger "save_post" Wordpress action.
Thanks | |
July 9, 2013 at 10:04 pm 5796 | |
So how and when are you inserting the activity in buddypress? | |
July 9, 2013 at 10:42 pm 5802 | |
I have created a WPUF form to add a new post. This form contains one or more custom-fields. For each post creates an activity in wich I need show the custom-fields of the post. | |
July 9, 2013 at 11:52 pm 5810 | |
Instead of applying a filter, you could directly publish an activity to buddypress using this trick. Wouldn’t be that easier? | |
July 10, 2013 at 12:02 am 5814 | |
I think this is an unnecessary complex trick. Buddypress can record posts to activity. My only need is add custom-fields to activity. Do you know how to trigger “save_post” WordPress action for each new post with WPUF? | |
July 10, 2013 at 12:06 am 5815 | |
You could fire the [php] add_action( ‘wpuf_add_post_after_insert’, ‘wpufe_bp_activity’ ); | |
July 10, 2013 at 1:55 am 5824 | |
I have tested and not work. Another problem is that wordpress give me this error” Warning: Missing argument 2 for bp_blogs_record_post() in /nfs/c08/h04/mnt/140927/domains/redminka.com/html/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php on line 214 “ | |
July 10, 2013 at 10:02 pm 5842 | |
Then I suggest insert an activity manually. | |
July 11, 2013 at 7:36 am 5862 | |
Hi @Tareq, I’m very grateful for all your help. | |
July 12, 2013 at 1:34 am 5889 | |
Finally I gave a try to see what are you doing wrong. Turns out, Here’s how: //get the last inserted activity // if activity found, update the activity with custom field $wpdb->update( add_action( ‘wpuf_add_post_after_insert’, ‘wpufe_modify_bp_activity’ ); | |
July 12, 2013 at 1:53 am 5895 | |
This works great!!!!!!!! I hope that you can update the plugin for that works perfect “out the box” with buddypress. Now I gonna update the solution in a buddypress and wpmu forums. Thanks! | |
July 12, 2013 at 1:56 am 5896 | |
Adding the solution to the plugin core is a bad idea. Everyone doesn’t run buddypress, so it’s waste of 2 SQL query. | |
July 12, 2013 at 2:07 am 5897 | |
Maybe an option that can unselect? Or maybe a item in the WPUF manual. I’m glad that find a solution. WPUF is a fantastic plugin, I don’t find any so complete |