Adding more onto an esc_url [closed]

To concatenate strings, PHP uses the concatenation operator .. Thus, to append a string to the current user link, you can use bp_core_get_userlink( get_the_author_meta( ‘ID’ ), false, true ) . ‘/posts/’ Note that I’ve removed the first part of the assignment from the $no_anchor and $just_link parameters, as the values should be passed, and not … Read more

override function from my plugin [closed]

In WordPress ‘do_action’ is used to add an action hook in a plugin, which then can be used to hook our own function with plugin. Check Codex for more details: Hooks API WordPress To add your own function you will have to do the following: add_action(‘groups_screen_group_request_membership’, ‘your_function_callback’); function your_function_callback($id){ //here id can be used to … Read more

How do I pull avatar from post using BuddyPress? [closed]

Try this: $author_id = get_the_author_meta(‘ID’); echo bp_core_fetch_avatar ( array( ‘item_id’ => $author_id, ‘type’ => ‘full’ ) ); Defaults: array( ‘item_id’ => false, ‘object’ => ‘user’, ‘type’ => ‘thumb’, ‘avatar_dir’ => false, ‘width’ => false, ‘height’ => false, ‘class’ => ‘avatar’, ‘css_id’ => false, ‘alt’ => ”, ’email’ => false, ‘no_grav’ => false, ‘html’ => true, … Read more

How to get all users that uploaded avatars or have gravatars? [closed]

This function bp_get_user_has_avatar() calls bp_core_fetch_avatar with this argument ‘no_grav’ => true so you could write your own function to see if a user is not using the default avatar: function lurie_avatar_check( $user_id ) { $retval = false; if ( bp_core_fetch_avatar( array( ‘item_id’ => $user_id, ‘no_grav’ => false, ‘html’ => false ) ) != bp_core_avatar_default( ‘local’ … Read more

Current User In Custom Menu Item URL [closed]

Congrats on figuring it out. Perhaps this would also work: function change_menu($items){ foreach($items as $item){ if ($item-> post_name == ‘the-slug’)/*replace “the-slug” with menu item post_name */ $item->url = bp_loggedin_user_domain() . ‘/events/my-events/?action=edit’; } return $items; } add_filter(‘wp_nav_menu_objects’, ‘change_menu’);

Change xprofile visibility options in Buddypress [closed]

There’s a filter for that: bp_xprofile_get_visibility_levels. It is used to filter an array of visibility levels, which is initialized like so: $this->visibility_levels = array( ‘public’ => array( ‘id’ => ‘public’, ‘label’ => _x( ‘Everyone’, ‘Visibility level setting’, ‘buddypress’ ) ), ‘adminsonly’ => array( ‘id’ => ‘adminsonly’, ‘label’ => _x( ‘Only Me’, ‘Visibility level setting’, ‘buddypress’ … Read more

Use BuddyPress data in loop (mkdir)

it doesn’t work (ie, the folder name will just be “User – ” (with no ID Number) Did you check to see if and what bp_member_profile_data( ‘field=ID Number’ ); returns as a value? And that function will echo the value. To just return the value use bp_get_member_profile_data( ‘field=ID Number’ ); But… For God’s sake… Why … Read more

BuddyPress: filter member based on Xprofile Field

Try: class BP_Custom_User_Ids { private $custom_ids = array(); public function __construct() { $this->custom_ids = $this->get_custom_ids(); add_action( ‘bp_pre_user_query_construct’, array( $this, ‘custom_members_query’ ), 1, 1 ); add_filter( ‘bp_get_total_member_count’, array( $this, ‘custom_members_count’ ), 1, 1 ); } private function get_custom_ids() { global $wpdb; //figure out if the logged-in user is engineer or it $s = xprofile_get_field_data( 2, bp_loggedin_user_id() … Read more