Forum Replies Created
-
In reply to: Is filtering Activity on CPT meta info possible?
Hi,
it’s not the solution but an example you can perhaps use.
The snippet handles the object members and sort them by type “contributing”
Replace object by activity and type by “beer” and see what you can do from that.// add order options to members loop function ch_member_order_options() { ?> <option value="contributing"><?php _e( 'Contributing Members', 'buddypress' ); ?></option> <?php } add_action( 'bp_members_directory_order_options', 'ch_member_order_options' ); // filter ajax members by contributing function ch_filter_ajax_querystring( $querystring = '', $object = '' ) { if( $object != 'members' ) return $querystring; $defaults = array( 'type' => 'active', 'action' => 'active', 'scope' => 'all', 'page' => 1, 'user_id' => 0, 'search_terms' => '', 'exclude' => false, ); $ch_querystring = wp_parse_args( $querystring, $defaults ); if( $ch_querystring['type'] == 'contributing' ) { // grab members by Member Type role declared on xprofile $users = get_users( array( 'fields' => array( 'ID' ), 'role' => 'contributor' ) ); $users_str = ''; foreach ( $users as $user ) { $users_str .= $user->ID . ','; } $users_str = rtrim($users_str, ","); $ch_querystring['include'] = $users_str; $ch_querystring['type'] = 'alphabetical'; return $ch_querystring; } else return $querystring; } add_filter( 'bp_ajax_querystring', 'ch_filter_ajax_querystring', 20, 2 );https://buddypress.org/support/topic/adding-new-order-by-on-members-loop/
In reply to: Video embed not working on Group Activity wallHi @curely,
auto embeding videos into WP is conditioned by certain rules. By default, embeding does only work for approved providers. FlowPlayer is not part of these.
But you can try to add it and see if embeding videos from that provider becames to work. Read here how to do that:
In reply to: tinymce post-form missing “post update” buttonIt is possible and that’s what i explained on both topics i indicated.
By default BP use only a textarea. You can add a WYSIWIG editor by using that snippet.
All that is WP stuff and is explained on WP’s codex.
Check you have correctly added anything to your custom page and if the button is still missing, check first the page source code from within your browser. If you find it in code but don’t see it on screen, there may be a css rule who hide it.
In reply to: How to hide profile menu items from other usersI use that function bpfr_custom_group_default_tab and it works.
Have you replaced the group slug to yours in ‘case’ ? This must fit the exact slug, the one you see by mouse over the group name in the bottom left corner of your brower (and normally in the browser’s address bar).Please ask one question at a time. Make an effort to be clear. It’s difficult to follow your post !
– I want to do this on profile: details, item names…
– I want to do this on groups: details, item names…
NB 1: if you want to change the landing tab for ALL groups, you can use:
define( 'BP_GROUPS_DEFAULT_EXTENSION', 'members' );With this, all groups will use the group members directory as landing tab instead the group activity.
If you want a different landing tab for each group, use the snippet and don’t use define.NB 2: the tab name has no influence on the landing tab. The name and the slug are handled separately, precisely because of that
NB 3: where you put functions in bp-custom has no importance.
In reply to: Link páginas BuddypressOlá! Desculpe, o nosso objectivo neste fórum falamos Inglês!
Sorry, but on this forum we speak English!
In reply to: tinymce post-form missing “post update” buttonIn reply to: How to hide profile menu items from other usersThe Home tab is the default one. If you remove that tab, BP has no way to know where to output the other group tabs content. If you remove Home(aka activity) you should define another landing tab.
But when you want to modify groups, you shouldn’t define ‘profile’, but ‘groups’. (read what you wrote!)
For the profile landing tab, see this codex page.For groups, you can try this snippet. This let you define a different landing tab for each of your groups (not profile, ok ?). 😉
function bpfr_custom_group_default_tab($default_tab){ /** * class_exists() is recommanded to avoid problems during updates * or when Groups Component is deactivated */ if ( class_exists( 'BP_Group_Extension' ) ) : // $group=groups_get_current_group();//get the current group if(empty($group)) return $default_tab; switch($group->slug){ case 'kill-bill': // group name (use slug format) $default_tab='forum'; break; case 'groupe-2014': $default_tab='members'; break; default: $default_tab='home';// the original default landing tab break; } return $default_tab; endif; // end if ( class_exists( 'BP_Group_Extension' ) ) } add_filter('bp_groups_default_extension','bpfr_custom_group_default_tab');In reply to: Change ‘Show all X comments’ limitGlobal.js is related to BP Default theme which is no more used since 1.9.
The “new” js you can check for comment count is \buddypress\bp-templates\bp-legacy\js\buddypress.js:667I don’t know how the default 5 count is set before firing Show all X comments link. But i haven’t read very attentively the whole js file.
If your goal is to gain some place on activity feeds, you may use a show/hide comment button ?
function add_comment_hide_show() { ?> <style> .single-group .activity-comments ul{display: none;} </style> <script type="text/javascript"> jQuery(function($) { setInterval(function() { $('.activity-meta').each(function() { if( !$(this).find('.show-comments').length ){ var html = '<a href="#" class="button bp-primary-action show-comments">Show/Hide Comments</a>'; $(this).find('.button.acomment-reply').after(html); } }); }, 500); $('body').on('click', '.show-comments', function(e) { e.preventDefault(); var obj = $(this).closest('.activity-content').next('.activity-comments').find('ul'); obj.slideToggle(); return false; }); }); </script> <?php } add_action( 'wp_footer', 'add_comment_hide_show' );Or if you want to limit the number of comment a member can leave on activities, BPDEVEL has a premium plugin called BP Rate Limit User Activity which can do that.
On Trac, some very old tickets about comments: #2768, #1870
Perhaps @dcavins can tell you more about this ?
In reply to: Change ‘Show all X comments’ limitNo need to play with JS.
BP follows the number of comments you fix in WP Settings > Discussion >
Other comments: Enable threaded (nested) comments [5] levels deep // default is 5In reply to: How to hide profile menu items from other usersNo, not for the moment. We’re handling here about profile and group nav, not about Group or Member Directory nav.
If you have a snippet who works for the Directory, feel free to add it to the Nav Api examples. Codex Contributors are always welcome.
In reply to: How to hide profile menu items from other users@socialc, since 2.6 and the new Nav API, there is a much simplier possibility as the translation file to change nav item names.
@marcono, try this; not sure you learned, below snippet is on Nav API examples i indicated previously. 😉
function bpcodex_rename_group_tabs() { if ( ! bp_is_group() ) { return; } buddypress()->groups->nav->edit_nav( array( 'name' => __( 'Group Discussion', 'buddypress' ) ), 'forum', bp_current_item() ); } add_action( 'bp_actions', 'bpcodex_rename_group_tabs' ); function bpcodex_rename_profile_tabs() { buddypress()->members->nav->edit_nav( array( 'name' => __( 'My Buddy Forums', 'textdomain' ) ), 'forums' ); buddypress()->members->nav->edit_nav( array( 'name' => __( 'My Buddy Groups', 'textdomain' ) ), 'groups' ); } add_action( 'bp_actions', 'bpcodex_rename_profile_tabs' );Make sure you have pretty permalinks enabled on your WordPress install. (whatever except default) and save.
And check your install again.
Ray’s script is not a bug tracker, it gives only information about global variables which is usefull when you want to debug a custom script. If you seek for bugs – rarely the case on a new install -, activate wp_debug in wp-config.phphttps://codex.wordpress.org/Debugging_in_WordPress
In reply to: Notification: redirect on tagged/quoted postPlease don’t bump!
In reply to: Posting guidleinesIn reply to: Custom post typeGlad you got it !
Sad you did it wrong by hacking a plugin core file (ignitiondeck-admin.php). What will happen to your modification at next Ignitiondeck update ?
Couldn’t your filter work from within bp-custom.php or theme’s functions.php ?
Has that plugin no hooks to extend it ?IMO a generous bad good idea.
In reply to: How to hide profile menu items from other usersbp_core_remove_subnav_item( 'settings', 'profile' );In reply to: [Resolved] BP 2.6 and BuddyPress Group Extras PluginIn reply to: Errors after update[MOD] Topic moved to a more appropriate forum.
The following plugins/widget are generating these error messages.
bp-edit-group-slug
BP_Toplevel_Groups_Widget
BP_Group_Navigator_Widget
bp-group-email
bp-group-hierarchy
You have to contact their authors via plugin support on WP repo.
and on your side:
The first step to getting rid of those Notices is identifying the source, so:
– switch momentarily to a WP theme like 2016 and see if any persist
– turn off plugins one at a time and see if any persistAbout the bbPress notice (bbp_setup_current_user was called incorrectly), read here:
https://buddypress.trac.wordpress.org/changeset/10709/In reply to: How to hide profile menu items from other usersIt’s the same principle, but not the same syntax since 2.6
To hide tabs on groups, you need to specify the component. Note that all menu items (nav and subnav items) are considered as sub-nav, they have not the same distinction as on member or activity menus.
Use another function for groups. Try this.
function bpex_remove_group_tabs() { if ( ! bp_is_group() ) { return; } $slug = bp_get_current_group_slug(); // hide items to all users except site admin if ( !is_super_admin() ) { // bp_core_remove_subnav_item( $slug, 'members' ); bp_core_remove_subnav_item( $slug, 'send-invites' ); // bp_core_remove_subnav_item( $slug, 'admin' ); // bp_core_remove_subnav_item( $slug, 'forum' ); } } add_action( 'bp_actions', 'bpex_remove_group_tabs' );To get more usage examples, see here:
In reply to: Working Login redirect to profile snippet ?When you copy/paste code you do not really control, try at least the original one first before adding wrong things to it.
For the redirect link, use this syntax:
return bp_core_get_user_domain( $user->ID ) .'/mypics';And please don’t double post. It’s annoying.
In reply to: [Resolved] Hidden admin panelDo you mean also that members can’t access to their profile settings when they are on their profile page ?
The BP usermenu on the Toolbar, under Howdy (top right) mimics the usermenu of the BuddyBar which is on each profile.
Have you enabled Extended Profiles ?
Or use this snippet to login redirect your users to their profile.
ps: i removed your site url as it is locked to public – which doesn’t help no one to help you.
In reply to: Login redirects not workinghi @earl_d,
add this snippet to bp-custom.php and give it a try.
function bpex_redirect_to_profile( $redirect_to_calculated, $redirect_url_specified, $user ){ if( empty( $redirect_to_calculated ) ) $redirect_to_calculated = admin_url(); // redirect logged in to his/her profile - except site admins if( isset( $user->ID) && ! is_super_admin( $user->ID ) ) return bp_core_get_user_domain( $user->ID ); else return $redirect_to_calculated; /* nada !*/ } add_filter( 'bp_login_redirect', 'bpex_redirect_to_profile', 11, 3 );For the redirect URL error you mentionned here, use:
return bp_core_get_user_domain( $user->ID ) .'/mypics';mypics is a slug, not a constant
( $user->ID ) .mypicsIn reply to: Custom post typeAnd no luck too by following instructions from the tutorial ?
There is a typo error in your code. The if is missing a
:<?php if ( is_user_logged_in() && is_super_admin() ) ?>should be
<?php if ( is_user_logged_in() && is_super_admin() ) : ?>In reply to: Several bad links. (I’m at a loss)Profile edit link is a contextual link who needs a user id
Actually a click on Edit profile in Custom profile links shows:http://social.tgdgaming.com/members/mgenjoker/friends/profile/profile/Why is it showing /friends/ ?
Why is it showing /profile/ twice ?The correct path you should get for this is:
http://social.tgdgaming.com/members/mgenjoker/profile/edit/Unable to tell more of what you made wrong. Check your settings, custom functions or whatever other things you have made to generate such a weird link.