bp_activity_add issue….
-
Quizás quisiste decir: Hola buenas tengo un problema intentando crear un simple record activity usando la funcion bp_activity_Add
Hi, I have a problem trying to create a simple record_activity using the bp_activity_Add function
function bp_example_record_activity( $args = '' ) { global $bp; if ( !function_exists( 'bp_activity_add' ) ) return false; $defaults = array( 'id' => false, 'user_id' => $bp->loggedin_user->id, 'action' => '', 'content' => '', 'primary_link' => '', 'component' => $bp->example->id, 'type' => false, 'item_id' => false, 'secondary_item_id' => false, 'recorded_time' => gmdate( "Y-m-d H:i:s" ), 'hide_sitewide' => false ); $r = wp_parse_args( $args, $defaults ); extract( $r ); return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); }
and add this in functions.php
bp_example_record_activity( array( 'type' => 'new_highfive', 'action' => 'Andy high-fived John', 'user_id' => $bp->loggedin_user->id, 'item_id' => $bp->displayed_user->id ) );?>
It wouldn’t be enough for me to add an item to my feed every time I reload (I’m testing in functions.php because I don’t know exactly where to put the function to run). But he does nothing here either
thanxs
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.