Forum Replies Created
-
Found this to try and override the has_activities via a filter https://codex.buddypress.org/developer/using-bp_parse_args-to-filter-buddypress-template-loops/
Thanks! adding the bp_enqueue_assets_in_bp_pages_only allowed buddypress scripts to be loaded outside of the buddypress generated pages.
For some reason, the ‘bp_has_activities’ in my activity loop no longer respects the array I pass in. Instead of just displaying the one bp_activity_id and the comments, it’s pulling all activities.
$prj_activity_args = array("include"=>$bp_activity_id); <div class="activity" data-bp-single="<?php echo $bp_activity_id; ?>"> if ( bp_has_activities( $prj_activity_args ) ) : ?> <?php if ( empty( $_POST['page'] ) || 1 === (int) $_POST['page'] ) :?> <div id="activity-stream" class="activity-list item-list bp-list" data-bp-list="activity"> <ul class="activity-list item-list bp-list"> <?php endif; ?> <?php while ( bp_activities() ) : bp_the_activity(); ?> <?php bp_get_template_part( 'activity/entry' );?> <?php endwhile; ?> <?php if ( empty( $_POST['page'] ) || 1 === (int) $_POST['page'] ) : ?> </ul> <!-- .activity-list --> </div> <!-- #activity-stream --> <?php endif; ?> <?php else : ?> <?php bp_nouveau_user_feedback( 'activity-loop-none' ); ?> <?php endif; ?> <?php// bp_nouveau_after_loop(); ?> </div> <!--#comments--> </div> <!--#buddypress-->
I checked on the my buddypress’s /activity stream page and I noticed in the page source, there’s something defined:
<script id="bp-nouveau-js-extra"> var BP_Nouveau = {"ajaxurl":"https:\/\/mysite.com\/wp-admin\/admin-ajax.php","confirm":"Are you sure?","show_x_comments":"Show all %d comments","unsaved_changes":"Your profile has unsaved changes. If you leave the page, the changes will be lost.","object_nav_parent":"#buddypress","objects":{"0":"activity","1":"members","3":"blogs","4":"xprofile","5":"friends","7":"settings","8":"notifications"},"nonces":{"activity":"945da9770f","members":"3c2b470980","blogs":"0a006184ba","xprofile":"56da19c4b1","friends":"a437ee2b51","settings":"ce8e7d03fe","notifications":"ac5a574aa8"},"newest":"Load Newest","pulse":"15","activity":{"params":{"user_id":20,"object":"user","backcompat":{"before_post_form":false,"post_form_options":false},"post_nonce":"a7c93b3f4e","avatar_url":"\/\/www.gravatar.com\/avatar\/c4568b23422db4e779e93c73130989dd?s=50&r=g&d=mm","avatar_width":50,"avatar_height":50,"user_domain":"https:\/\/mysite.com\/members\/pen\/","avatar_alt":"Profile photo of Pen","objects":{"profile":{"text":"Post in: Profile","autocomplete_placeholder":"","priority":5}}},"strings":{"whatsnewPlaceholder":"What's new, Pen?","whatsnewLabel":"Post what's new","whatsnewpostinLabel":"Post in","postUpdateButton":"Post Update","cancelButton":"Cancel"}}};
I can’t find what creates this script / variable.
Hi @imath,
I have a similar / related issue. I’m using Restrict Content Pro’s registration page with the latest Buddypress version (12.1.1) on a staging site and my registration page broke. It told me “Member registration is currently not allowed”, even if I disable the buddypress plugin.
I tried the gist you posted https://gist.github.com/imath/c5c34feb5d3c9b3070f7a11bc339f103 in my child theme’s functions.php but the registration page still does not work. Any ideas?
*Update* – I read through the earlier post and found the first workaround – going to Buddypress Settings -> URLs, but did not see any option to change the register slug. I had to briefly turn on wordpress general settings “Anyone can register” so that more options would appear in “URLs”. I was able to set the slug to something else like ‘sign-in’ and that seemed to allow my RCP registration to function again.
Just to check, I disabled “Anyone can register”. Seems like the BP slug change stuck and my RCP registration is operational.
Is this documentation old? https://codex.buddypress.org/developer/loops-reference/the-activity-stream-loop/
include optional
Pass an activity_id or string of comma separated ids to show only these entries.Default value: false
Even when I update the argument to an array, all the activities are still being loaded –
array("include"=> array(2) );