Forum Replies Created
-
In reply to: How to Count Custom Post Types in Nav Tabs?
I don’t know why it would work in
bp_before_member_header_meta.I usually use a direct call for such counts.
Try something like:function 3tmj_count_profile( $user_id = 0 ) { global $wpdb; if ( empty( $user_id ) ) $user_id = bp_displayed_user_id(); return $wpdb->get_var( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_author = $user_id AND post_type IN { 'video','discography','post' } AND post_status = 'publish'" ); }Then implement – note the parent url:
function bpck_post_profile_setup_nav() { $parent_slug = 'post'; $child_slug = 'post_sub'; $count = 3tmj_count_profile(); $class = ( 0 === $count ) ? 'no-count' : 'count'; $name = sprintf( __( 'My Posts <span class="%s">%s</span>', 'your-lang-domain' ), esc_attr( $class ), number_format_i18n( $count ) ); bp_core_new_nav_item( array( 'name' => $name, 'slug' => $parent_slug, 'parent_url' => bp_displayed_user_domain() . $parent_slug . '/', 'screen_function' => 'profile_page_show_screen', 'position' => 40, 'default_subnav_slug' => $child_slug ) ); }The WP function to determine if the current user is an administrator is:
is_super_admin()So something like:
if ( is_super_admin() ) // show the menu itemWhich menu item?
In reply to: WP User Avatar Not Showing in BuddyPressBP will not use WP avatars and there is no viable way to do it.
In reply to: WP User Avatar Not Showing in BuddyPressBP uses a different system for avatars.
They will reside in the uploads folder.
For example, this is the path for a member whose ID = 1
.../wp-content/uploads/avatars/1/
And in that directory there will be a thumb-size image and a full image.
But first, that user has to upload an avatar via their profile.This will remove the Email tab.
function waqas_remove_friends_activity_nav() { bp_core_remove_subnav_item( 'settings', 'notifications' ); } add_action( 'bp_setup_nav', 'waqas_remove_friends_activity_nav', 15 );This will set all the notification settings to ‘no’ for a specific user:
function waqas_email_notifications( $user_id ) { $settings = bp_settings_get_registered_notification_keys(); foreach ( $settings as $setting ) { bp_update_user_meta( $user_id, $setting, 'no' ); } }For new users, you could do this:
function waqas_bp_core_activated_user( $user_id, $key, $user ) { waqas_email_notifications( $user_id ); } add_action( 'bp_core_activated_user', 'waqus_bp_core_activated_user', 10, 3 );bp_loggedin_user_domain()will provide the url to the user’s frontend profile.Re private message button, try:
function masoud_remove_private_message_button( $button ) { if ( ! is_super_admin() ) $button = ''; return $button; } add_filter( 'bp_get_send_message_button', 'masoud_remove_private_message_button', 1 , 1 );In reply to: private buddy pressIt only affects non-logged-in-users.
If you want support for bbPress, then you need:
BP Simple Private ProIn reply to: [Resolved] Need to change profile fields colourgoogle: ‘css alternate row color’
On your site, in a browser such as Chrome or Firefox, right click on a row and use the Inspector tool to find out where those colors are being controlled in your css.
In reply to: private buddy pressWP users are BP users, except for the profile fields you add in wp-admin > Users > Profile Fields
For granular control of both WP and BP content re logged-in vs. not-logged-in, have you tried BP Simple Private ?
You can get it here: WP Repo – BP Simple Private
Or here: PhiloPress – BP Simple Private
In reply to: Users cannot register since update 2.53You can get older versions here:
https://wordpress.org/plugins/buddypress/developers/In reply to: Buddypress member directoryThis premium plugin – BuddyProfileData – will add profile data to the members loop.
It will add fields in a vertical stack.
If you are comfortable with css and maybe a little php, you can change it to horizontal.Or you can write your own solution using this hook:
do_action( 'bp_directory_members_item' );
in this file:
buddypress\bp-templates\bp-legacy\buddypress\members\members-loop.phpOr you can create a template overload of that file and hardcode your solution directly in the template wherever and however you want it.
Re the ‘>’ – the best solution is to find out where it is being added by your theme css and change it.
In reply to: help in writing a function? hooks? actions?Try using some other page:
$r['root'] = site_url( '/put-slug-here/' );If that works, it should give you a clue.
If not, I don’t have any more suggestions.In reply to: help in writing a function? hooks? actions?$ris an arrayTry
function masoud_core_no_access( $r ){ $r['mode'] = 1; $r['root'] = site_url( '/login/' ); return $r; } add_filter( 'bp_core_no_access', 'masoud_core_no_access' );Have you tried using a standard theme like WP 2015?
Are you running any membership plugins or code that affects profile fields?
You may want to wipe the installation, including the database, and start over.
In reply to: help in writing a function? hooks? actions?Please use the
codebutton when sharing code.If the hook uses
apply_filters, then useadd_filter.function masoud_core_no_access( $r ){ // $r is an array // make adjustments or other calls and then return it return $r; } add_filter( 'bp_core_no_access', 'masoud_core_no_access' );Find out which S2 function returns member ids based on S2 levels.
Then look at this function
bp_has_members. It hasincludeandexcludearguments.If you have more paying members than non-paying members, then pass the non-paying member ids to the
excludeargument.
Otherwise, pass the paying member ids to theincludeargument.You can adjust the
bp_has_memberscall in your Members Directory template.Or you can write a function using this approach:
https://codex.buddypress.org/developer/using-bp_parse_args-to-filter-buddypress-template-loops/In reply to: Buddypress activity pagesYou’ll probably want to create a new page and then load a custom template.
In your custom template, you’ll need to create an Activity loop with the parameters that you want.
Sounds like this is your first time performing these tasks.
Give it a serious and thorough attempt and see how far you can get.
If you get stuck, use gist or pastebin to share the code in your custom template.Please do not paste all the code on these forums.
In reply to: It doesn’t work you have a friendship requestTo reveal if the issue is in your theme, try switching momentarily to a theme like WP 2013 and test again.
Thanks for your concern.
The responsible way to report a security issue is to:
2. Open a ticket here – using the same user/pw you use for these forums.
In reply to: BP Profile SearchBP xProfile Location creates an xProfile field type.
And it will include any of those field types on the the search form created by BP Profile Search.I think you want to use Google to auto-populate the textbox(es) created on the search form, based on user input.
That would require custom code added to the BP Profile Search plugin.
You will have to write that code yourself or hire a developer.just fyi: you can replace this:
! bp_current_user_can( 'bp_moderate' )with this:
! is_super_admin()In reply to: Associating group to course crashes siteThe errors in your log all seem to be related to LearnDash . BuddyPress calls.
Your best bet is to show that log to the LearnDash support team.