July 3, 2013 at 9:14 am 5524 |
July 3, 2013 at 1:32 pm 5530 |
ggsalas
| @quokka I tried your change but no result.
@Tareq When I set get_post_meta to “true” I have no results.
In this code the only text appears is “This”:
add_filter( 'bp_blogs_activity_new_post_content', 'record_post_activity_content',1, 3 );
function record_post_activity_content($activity_content, $post,$post_permalink ){
global $post;
return get_post_meta($post->ID, 'txt_link', true).'This';
}
Thanks for your help, I hope can resolve.
|
July 3, 2013 at 1:42 pm 5532 |
July 3, 2013 at 7:06 pm 5561 |
July 3, 2013 at 7:47 pm 5563 |
July 8, 2013 at 7:30 pm 5691 |
July 8, 2013 at 8:31 pm 5694 |
July 11, 2013 at 10:17 pm 5885 |
ggsalas
| Hi @quokka I have tested your plugin and do the same error:

<?php
/*
Plugin Name: WPUF POSTS TO Buddypress Activity Stream
Plugin URI: http://www.basdebie.com
Description: This plugin hooks into WP User Frontend and posts to the Buddypress Activity Stream on new photoalbum submission
Version: 1.0
Author: Bas Debie modif.
Author URI: http://www.basdebie.com
License: GPL2
*/
/**
* Record an activity item
* This code is taken from Nicolas Crocfer's BuddyPress Portfolio Plugin
*/
function bd_custom_bp_record_activity( $args = '' ) {
if ( !function_exists( 'bp_activity_add' ) )
return false;
$defaults = array(
'id' => false,
'user_id' => '',
'action' => '',
'content' => '',
'primary_link' => '',
'component' => 'post',
'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 ) );
}
/**
* After post update the Buddypress Activity Stream
*/
function bd_after_post_insert( $post_id ) {
global $bp;
$activity_content = get_post_meta($post->ID, 'txt_link', true).'this yes ahora';
// if( get_post_type( $post_id ) == "photoalbum" ) {
bd_custom_bp_record_activity( array(
'user_id' => $bp->loggedin_user->id,
'action' => sprintf(__('%s creó una nueva publicación \''.get_the_title($post_id).'\' at %s'), "<a href='".$bp->loggedin_user->domain."/'>".$bp->loggedin_user->fullname."</a>", get_permalink( $post_id ) ),
'primary_link' => get_permalink( $post_id ),
'type' => 'new_post',
'item_id' => $bp->loggedin_user->id,
));
// }
}
add_action( 'wpuf_add_post_after_insert', 'bd_after_post_insert' );
?>
|
December 19, 2014 at 4:04 am 32576 |