Hi There, Is It Possible to Filter only Videos from Buddypress Activity Stream and Place Those Filtered Posts on a Seperate Page?
I Mean Something Like A Page Known as Videos Or Something, which Will Contain Only Videos from Sitewide Activity.
Hi Cromacio,
Thank you for the question.It will depend on how the videos are being added. Is the video uploading/adding creates new activity type? If yes, It can be easily filtered.
Regards
BrajeshHi Brajesh, Thanks for Reply.
Unfortunately, It Doesn’t Seem that a New Activity Type is Created based on Videos.
Do I Need to Do Something to Create New Activity Types on Adding Videos? Or Any Can It Still Be Filtered Directly?
Thank You 🙂A Thing More, I Use the Following Code from Your Posts –
function buddydev_friends_only_activity_args( $args ) { if( ! bp_is_activity_directory() || ! is_user_logged_in() ) { return $args; } $user_id = get_current_user_id(); $user_id_admin = 1; $user_id_manager = 32; $user_ids = friends_get_friend_user_ids( $user_id ); //include users own too? array_push( $user_ids, $user_id, $user_id_admin, $user_id_manager); $args['user_id'] = $user_ids; //print_r($args); return $args; } add_filter( 'bp_after_has_activities_parse_args', 'buddydev_friends_only_activity_args' )
Can I Make Everything Visible to the Admin Account, I Mean No Filtering Happens when An Admin user is Logged In (or User with User ID= 1) and Admin Sees All Activites.
Adding Something Like ‘If Is User ID 1 then Do Not Return Args’ ?
Any Other Suggestions regarding the Code I Already Use is Appreciated too.Thank You,
CromacioHi Cromacio,
Thank you for the reply.1. In order to filter the activity, we need some way to identify the videos( either via component or type or any other attribute of the activity, search by string may work but does not feel the right approach )
2. Please change this line
if( ! bp_is_activity_directory() || ! is_user_logged_in() ) { return $args; }
to
if( ! bp_is_activity_directory() || ! is_user_logged_in() || is_super_admin() ) { return $args; }
That will avoid filtering for super admins.
Regards
BrajeshHi Brajesh,
Thanks for Reply (Even on Weekends😅)Will Look into Something that Will Create A New Activity Type or Something.
Updated the Next Line of Code, Thanks for That 🙂Cromacio
Hi Cromacio,
You are welcome 🙂Regards
Brajesh
You must be logged in to reply to this topic.