Forum Replies Created
-
In reply to: Redirect users who aren’t logged in
Hi,,
this snippet is similar to the previous, except that it restrict access to BP components and bbPress (remove thoose you want to keep open)function bpfr_guest_redirect() { global $bp; // enter the slug or component conditional here //if ( bp_is_activity_component() || bp_is_groups_component() || bp_is_blogs_component() || bp_is_directory() || bp_is_user() || bp_is_members_component() ) if ( bp_is_activity_component() || bp_is_groups_component() || bp_is_blogs_component() || bp_is_page( BP_MEMBERS_SLUG ) || is_bbpress() ) { // not logged in user - user will be redirect to any link to want if( !is_user_logged_in() ) { //wp_redirect( get_option('siteurl') ); //back to homepage wp_redirect( get_option('siteurl') . '/register' ); // back to register page //wp_redirect( get_option('siteurl') . '/your_page_title' ); // back to whatever page // wp_redirect( get_option('siteurl') . '/wp-login.php/' ); } } } add_filter('get_header','bpfr_guest_redirect', 1 );In reply to: mySql querry helpHi,
query seems to be correct, but you probably have to read through your plugin doc & tutorials:… and, please, use the code button when you enter code on the forum.
In reply to: Pagination gives error on buddypress tabI would like to display only one tab… simply remove the code used for comments.
Have you more than 3 posts (my per_page setting is 3 by “page”), so pagination can show up ? And have you tested with a Twenty theme. I tested succesfully the code on 2012 via bp-custom, not as plugin (if it makes a difference)…In reply to: Pagination gives error on buddypress tab? no idea. Here what is working for me: https://gist.github.com/chouf1/342c08eb8be9432ae97f
for posts and comments on 2 sub tabs
Note that the comment pagination doesn’t work for post pagination, so the’re 2 different techniques in useIn reply to: Profile Field Text Area Max Character or Word LengthHi,
read here, maybe it helps
https://buddypress.org/support/topic/how-to-check-if-the-length-of-field-is-too-long/or try:
https://wordpress.org/plugins/buddypress-xprofile-validate-with-regex/In reply to: Pagination gives error on buddypress tabHi,
try this:
function ggsalas_profile_pagination( $wp_query ) { $profile_page_links = paginate_links( array( 'base' => @add_query_arg('pubs','%#%'), 'format' => '?pubs=%#%', 'total' => ceil( (int) $wp_query->found_posts / (int) get_query_var('posts_per_page') ), 'current' => (int) get_query_var('paged'), 'show_all' => true, 'type' => 'plain' )); // Output pagination return $profile_page_links; }In reply to: Code for adding new members to groups automatically?Hi,
This question was asked many times in the past. Search the forum. Ie.
In reply to: Rename Home URL+Slug in BP GroupHi @sharmavishal,
i would rather try to modify BP Group Extras, as it is this plugin who generate the “not great” slug.
If you have coding experience, you could try to hook into BPGE, or at least ask @slaffik how to do this.In reply to: Restricting Group Deletion to Super AdminCheck for group_creator.
In reply to: Rename Home URL+Slug in BP GroupIMO, you’re strugling with something unnecessary.
The group home tab shows the group activity by default and URL when on this page isdomain.com/groups/groupname/Your function is ok and it is not necessary to add /activity/ to the original slug. The action name for group activity page is
home. If you add it manually to ‘domain.com/groups/groupname/home’, home will be stripped by default. And if you change home to xyz, you’ll get a 404 error.Renaming the tab to a more accurate string is possible of course. Changing the group activity URL isn’t.
function my_bp_groups_default_tab() { global $bp; $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['name'] = 'Group Activity'; } add_action('bp_groups_setup_nav', 'my_bp_groups_default_tab');Thanks, not always, but you’re welcome ! 😉
In reply to: Restricting Group Deletion to Super AdminHi,
simply remove the delete group button from group admin. Give this a try, only site admin will see the button. Add snippet to bp-custom.php
function kwahlquist_remove_group_admin_tab() { global $bp; if ( ! bp_is_group() || ! ( bp_is_current_action( 'admin' ) && bp_action_variable( 0 ) ) || is_super_admin() ) { return; } // Add the admin subnav slug you want to hide in the following array // other admin subnav items are: group-settings, group-avatar, group-invites, manage-members $hide_tabs = array( 'delete-group' => 1 ); // since BP 2.2 $slug = bp_get_current_group_slug() . '_manage'; // Remove the nav item foreach ( array_keys( $hide_tabs ) as $tab ) { bp_core_remove_subnav_item( $slug, $tab ); } } add_action( 'bp_groups_setup_nav', 'kwahlquist_remove_group_admin_tab', 9 );Hi @romanzy,
Give this a try. Add snippet to bp-custom.php
function descrition_field_remove_html_filter() { remove_filter( 'bp_get_the_profile_field_description', 'wp_filter_kses' ); } add_action( 'bp_init', 'descrition_field_remove_html_filter' );In reply to: Error 404 on all components of buddypressHi,
deactivate any plugins except buddyPress and follow the BP’s install guide .
In reply to: Activity stream disappears in WordPress dashboardDid you activated permalinks ? Is mod_rewrite on in htaccess ?
Details here.In reply to: Activity stream disappears in WordPress dashboardHi @skvirly,
unfortunately, i think nothing about your issue, except that it seems that something is interfering somewhere.
The best practice in such case is to start from the begin.
Activate WordPress and 2015 theme. Check that anything is correctly working.
Then activate BuddyPress. Re-check.
Then bbPress. Re-check.
Then, activate Sweet Date theme. Re-check.If all is Ok, and only if all, you now have a base install of WP/BP/bbP and your theme working correctly. There shouldn’t be any notice or warning at this stage. If you got one, it’s a probleme with the theme.
If this is ok, you add one plugin. And re-check. This normally make things easier to debug.
As it is apparently related to xprofile, it could be possible that if you use contactform plugin for your register page, that something is wrong with that plugin. But this is only a hypothesis, not a certainty.Note that php memory_limit of 128 mo is enought to run a script, when BP is running on a single install. Aside, note also it’s default for php 5.6 version.
Happy debuging.
In reply to: No Avatar Uploader for GroupsGive a try with 2015 theme.
Note that Genesis Connect (latest was 2014-1-25) is a backward compatibility plugin for BP that was installed prior to version 1.7. Though that plugin is interfering with group photo.In reply to: Hold new profiles for approval?Please provide a valid activation key is a msg which is generally fired when you’re in a same browser session.
Example, when as site admin, you’re testing a new user registration. Close the window, or clear history cookie before you login as this new user.In reply to: Hold new profiles for approval?Hi,
see if this plugin fit to your need:
https://wordpress.org/plugins/bp-registration-options/In reply to: Change text on Registration pageAs it only concern 2-3 strings, poEdit would be too much. Use an online converter tool. See http://po2mo.net/
In reply to: How to replace “Groups” with “Campaigns”The easiest way for that is to use the language file.
In reply to: Registration and Activation pagesPlease, try to do something before asking such trivial question. Seems you never used/modified a profile avatar. BuddyPress has no album or gallery. This can be added by plugin.
You can add custom option fields for References and Places Worked:
Not sure that adding a memberlist as drop down is very clever. What if you get a community of hundreds of members ?
To get database info, see here: (that’s a common WP task)
https://codex.wordpress.org/Class_Reference/wpdbIn reply to: Change text on Registration pageThe easiest way for that is to use the language file.
In reply to: Activity stream disappears in WordPress dashboardDeactivate all plugins and reactivate them one by one until you find a culprit.
There is no other way to debug.
Activate also debug mode in wp-config, perhaps you get some php warning or notice which may help you to isolate something.