Forum Replies Created
-
Try:
function iuda_screen_content() { bp_core_redirect( 'https://failtrafic.ro/wp-admin/' ); }is_super_admin()checks to see if the current user is an administrator.
To check if they are an editor, you need to check whether they have an editor permission.Try:
if ( is_super_admin() || current_user_can('editor') ) {Yes, use
is_super_admin()For example:
function add_iuda_tab() { global $bp; if ( is_super_admin() ) { bp_core_new_nav_item( array( 'name' => 'Iuda', 'slug' => 'iuda', 'parent_url' => $bp->displayed_user->domain, 'parent_slug' => $bp->profile->slug, 'screen_function' => 'iuda_screen', 'position' => 200, 'default_subnav_slug' => 'iuda' ) ); } } add_action( 'bp_setup_nav', 'add_iuda_tab', 100 ); function iuda_screen() { add_action( 'bp_template_title', 'iuda_screen_title' ); add_action( 'bp_template_content', 'iuda_screen_content' ); bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) ); } function iuda_screen_title() { echo 'iuda Title<br/>'; } function iuda_screen_content() { echo 'iuda Content<br/>'; }In reply to: Custom page in buddy pressPlease use the
codebutton when sharing code.'show_for_displayed_user' => true,In reply to: BuddyPress Comment Button Not WorkingTalk to your theme author.
In reply to: MySQL Query for Current Member> Query runs fine when I replace bp_displayed_user_id() with an integer.
You need to adjust your sql so that it uses a variable.
Try something like :$user_id = bp_displayed_user_id(); ... where wpyn_ks_trick_post.ID = $user_idThis is a basic php / mysql issue. There are lots of tutorials on the subject.
In reply to: BuddyPress Comment Button Not WorkingIt may be due to a javascript conflict with your theme or some other plugin.
To check if it’s your theme, try switching momentarily to a WP theme like 2015 and see if the issue persists.
In reply to: Users can’t join groupIt’s doubtful that anyone here will have a solution.
It’s probably due to a conflict with your theme or some other plugin.
To check if it’s your theme, try switching momentarily to a WP theme like 2015 and see if the issue persists.
In reply to: MySQL Query for Current Memberbp_displayed_user_id()
http://hookr.io/functions/bp_displayed_user_id/In reply to: Getting two warnings after installing BuddyPressThere is a conflict between BP and the shortpixel-image-optimiser plugin.
Did you ask the creators of that plugin about the warnings?In reply to: Members page: Hide defaut search fieldYou can remove it by creating a template overload of this file:
buddypress\bp-templates\bp-legacy\buddypress\members\index.phpRemove this code:
<?php /* Backward compatibility for inline search form. Use template part instead. */ ?> <?php if ( has_filter( 'bp_directory_members_search_form' ) ) : ?> <div id="members-dir-search" class="dir-search" role="search"> <?php bp_directory_members_search_form(); ?> </div><!-- #members-dir-search --> <?php else: ?> <?php bp_get_template_part( 'common/search/dir-search-form' ); ?> <?php endif; ?>Deleting
is_confirmed=0may help in the short term.
Trimming other tables can help.It sounds like your site is having overall resource issues.
And often ‘optimized for WP’ approaches don’t work for BP because you can’t use the same caching methods- ie. objects.
You’ll need to talk to your host and find out exactly how resources are allocated and being used.In reply to: Members-loopSo you want to change the display format?
Get the value :
$val = bp_get_member_profile_data( ‘field=the field name’ );Then format it however you want, for example:
echo date('Y', strtotime($val) ) . ' years';In reply to: redirect after loginTry:
function custom_login_redirect_to($user_login, $user) { bp_core_redirect( get_option('siteurl') . '/members/' . $user_login ); } add_action('wp_login', 'custom_login_redirect_to', 10, 2);Friend relationships, including pending, are stored in the _bp_friends table.
If a request is pending, theis_confirmedfield value will be0.You could try making a backup of that table and then deleting all rows where the
is_confirmedfield value =0.In reply to: User Profiles don’t appear inYou should see all fields, even empty ones, on the Profile > Edit page.
In reply to: User Profiles don’t appear inEmpty fields will not be shown on Profile > View.
Are you sure there is data in those fields?You could narrow down the issue by deactivating the LearnDash plugins one at a time and see if the issue persists.
In reply to: Don’t hide fields when user views his own profileYou can change parameters by passing an array in your overload.
Example – you may need to change the passed values.
<?php $args = array( 'hide_empty_groups' => false, 'hide_empty_fields' => false ); if ( bp_has_profile( $args ) ) : ?>In reply to: Don’t hide fields when user views his own profileMore precisely – replace it with:
<?php if ( bp_is_my_profile() ) : ?> <tr<?php bp_field_css_class(); ?>> <td class="label"><?php bp_the_profile_field_name(); ?></td> <td class="data"><?php bp_the_profile_field_value(); ?></td> </tr> <?php elseif ( bp_field_has_data() ) : ?> <tr<?php bp_field_css_class(); ?>> <td class="label"><?php bp_the_profile_field_name(); ?></td> <td class="data"><?php bp_the_profile_field_value(); ?></td> </tr> <?php endif; ?>In reply to: Don’t hide fields when user views his own profileThe easiest way is to create a template overload of this file:
buddypress\bp-templates\bp-legacy\buddypress\members\single\profile\profile-loop.phpThen, in the overload, remove this conditional:
if ( bp_field_has_data() )In reply to: change default subnavYou’re trying to use a deprecated approach – don’t.
You may need to adjust the
default_subnav_slugin the call to bp_core_new_nav_item, if that’s how they are creating the Events tab.Have you tried asking the creators of the Events Manager plugin ?
In reply to: change default subnavIt’s unclear what you’re trying to do.
But to add a tab to a subnav, you should use bp_core_new_subnav_item.Are you using BuddyPress?
bbPress has a separate support forum.
Your error message shows that it is caused by this plugin: smartlib-tools.
You should talk to the creators of that plugin.Maybe you could use this hook in
buddypress\bp-core\bp-core-attachments.php:
do_action( $object_data['component'] . '_cover_image_uploaded', (int) $bp_params['item_id'] );And delete any existing meta re the choices you provide.