In regards to the COVID-19 situation

Your support team is currently doing their best to offer the best support possible despite the current COVID-19 situation. However during these exceptional circumstances, please note that you should expect a response time of 2-3 business days, until further notice.Rest assured that we will still do our best to handle your requests as soon as possible! Everyone stay safe and healthy! 😷

Display PMP Pro Level on BP Member Directory Cards

  • This topic has 9 replies, 2 voices, and was last updated 2 years ago by Joss.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • Joss
    Participant
    • 34 Topics
    • 85 Posts

    Hi,

    You gave me a code snippet to display Member Type and City on BP Member Directory Cards last week.

    I found another solution to display city on card profile, now I would like to display Paid Membership Pro Level, can you modify your code bellow to display PMP Pro Level on BP Member Directory Cards and Profile…?

    Thanks a lot,
    Joss

    /* YOUR CODE */

    add_action( ‘gwangi_buddypress_member_xprofile_custom_fields’, ‘gwangi_buddypress_member_type’, 10 );
    add_action( ‘gwangi_buddypress_member_xprofile_custom_fields’, ‘gwangi_buddypress_member_type’, 10 );

    function gwangi_buddypress_member_type() {
    if ( bp_is_user() ) {
    $user_id = bp_get_displayed_user()->id;
    }
    else {
    $user_id = bp_get_member_user_id();
    }

    $member_type_name = bp_get_member_type( $user_id );
    $member_type = bp_get_member_type_object( $member_type_name );
    ?>
    <div class=”bp-member-xprofile-custom-field bp-member-type”><?php echo $member_type->labels[‘singular_name’]; ?></div>
    <?php
    }

    if ( ! function_exists( ‘gwangi_bp_xprofile_location_member_location’ ) ) :
    /**
    * Print the HTML for BP xProfile Location Field in the BP Member Directory.
    *
    * @since 1.1.9
    */
    function gwangi_bp_xprofile_location_member_location() {
    if ( function_exists( ‘xprofile_get_field_data’ ) ) :
    $location = xprofile_get_field_data( ‘Mon adresse’, bp_get_member_user_id() );
    $allowed_html = array(
    ‘a’ => array(
    ‘href’ => array(),
    ‘rel’ => array(),
    ),
    );

    if ( ! empty( $location ) ) :
    $location_parts = explode( ‘, ‘, $location );
    if ( ! empty( $location_parts[1] ) ) : ?>
    <div class=”bp-member-xprofile-custom-field bp-member-location”><?php echo wp_kses( $location_parts[1], $allowed_html ); ?></div>
    <?php
    endif;
    endif;
    endif;
    }
    endif;

    Themosaurus
    Keymaster
    Themosaurus Support
    • 2 Topics
    • 1678 Posts

    Hi @joss,

    Unfortunately, your request is outside the scope of the support that we can provide for our theme. It’s more a customization request than a simple fine tuning of a function that we’ve created for our theme.

    Please also note that this issue is related with the use of Paid Memberships Pro, not with the use of your theme. It’s best if you try to reach the plugin authors as they will be more informed and better suited to help you.

    To go further, we invite you to post your request on their support forums:

    Support

    To help you to quickly add this feature to the member cards and profiles, we recommend that you ask the PMPro support team to give the function to hook to the following theme action: gwangi_buddypress_member_xprofile_custom_fields.

    We remain available for all support requests related with the use of your theme.

    Best,

    Joss
    Participant
    • 34 Topics
    • 85 Posts

    Hi,

    It’s YOUR code snippet !!

    You don’t want to modify it ?

    Yet I’m sure you have the skills to do that…

    add_action( 'gwangi_buddypress_member_xprofile_custom_fields', 'gwangi_buddypress_member_type', 10 );
    
    function gwangi_buddypress_member_type() {
    	if ( bp_is_user() ) {
    		$user_id = bp_get_displayed_user()->id;
    	}
    	else {
    		$user_id = bp_get_member_user_id();
    	}
    
    	$member_type_name = bp_get_member_type( $user_id );
    	$member_type = bp_get_member_type_object( $member_type_name );
    	?>
    	<div class="bp-member-xprofile-custom-field bp-member-type"><?php echo $member_type->labels['singular_name']; ?></div>
    	<?php
    }
    
    if ( ! function_exists( 'gwangi_bp_xprofile_location_member_location' ) ) :
    	/**
    	 * Print the HTML for BP xProfile Location Field in the BP Member Directory.
    	 *
    	 * @since 1.1.9
    	 */
    	function gwangi_bp_xprofile_location_member_location() {
    		if ( function_exists( 'xprofile_get_field_data' ) ) :
    			$location     = xprofile_get_field_data( 'Location', bp_get_member_user_id() );
    			$allowed_html = array(
    				'a' => array(
    					'href' => array(),
    					'rel'  => array(),
    				),
    			);
    			if ( ! empty( $location ) ) : ?>
    				<div class="bp-member-xprofile-custom-field bp-member-location"><?php echo wp_kses( $location, $allowed_html ); ?></div>
    			<?php
    			endif;
    		endif;
    	}
    endif;
    Themosaurus
    Keymaster
    Themosaurus Support
    • 2 Topics
    • 1678 Posts

    Hi @joss,

    Yes, we do have the skills to change this. However, we don’t have the knowledge required to display this PMPro info… And we don’t know which function to use as this request is not related with the use or fine tuning of our product, but pretty much with the improvement of your PMPro experience.

    So, it’s best if you try to reach the plugin authors as they will be more informed and better suited to help you.

    We remain available for all support requests related with the use of your theme.

    Best,

    Themosaurus
    Keymaster
    Themosaurus Support
    • 2 Topics
    • 1678 Posts

    Please also note that you don’t need to edit our snippet to achieve this as we recommend to add a new function to the following theme action: gwangi_buddypress_member_xprofile_custom_fields.

    Best,

    Joss
    Participant
    • 34 Topics
    • 85 Posts

    I understand, but with their support it’s very long to get an answer…

    Joss
    Participant
    • 34 Topics
    • 85 Posts

    Hi,
    I seemed to have answered this conversation…

    Look at the reply of PMP Pro support :


    “Hello. Since I’m unfamiliar with the theme specifics, I can give an overview on how to access a users membership level, and level description. Your theme developer should be able to then assist with having it actually display in their theme.

    First, we need to get the members membership level. This can be done using the function pmpro_getMembershipLevelForUser():

    https://github.com/strangerstudios/paid-memberships-pro/blob/dev/includes/functions.php#L1693

    $level = pmpro_getMembershipLevelForUser();

    The $level is a PHP object and contains the necessary information. You can access the level name as $level->name and the description is $level->description.”

    Can you make me this code snippet now ?

    Thanks,
    Joss

    Joss
    Participant
    • 34 Topics
    • 85 Posts

    Hi,

    Can you read the PMP Pro reply ?

    Can you make me the code or not ?

    Thanks,
    Joss

    Themosaurus
    Keymaster
    Themosaurus Support
    • 2 Topics
    • 1678 Posts

    Hi @joss,

    We really appreciate the way that you value our coding skills. However, your request doesn’t imply any correction of our codebase, like when we shared the snippet to change the display of xProfile fields for instance. You’re expecting the addition of a new feature…

    You can either ask us to move this request to our “Feature Request” forum. In this case, we’ll implement this feature in a coming update if other Gwangi users show interest for this.

    If you’re in a hurry, we recommend you try to reach MeshPros and request a customization quote:

    Request a Quote

    These guys are the author of Match me for BuddyPress, a plugin that recommended to provide the matchmaking feature to your website. You might be already using it. They’ve quite a lot of experience with WordPress and BuddyPress development and might be better suited to help you.

    If you’re on a tight budget, we recommend you to require the services from Envato Studio freelancers (https://studio.envato.com/explore/websites-programming). This web platform gives you access to developers who have already experience with theme customizations, and for very competitive prices.

    Best,

    Joss
    Participant
    • 34 Topics
    • 85 Posts

    Ooooooohhhhh,

    It’s a shame, I’m sure you know how to do it 🙁

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

Troubleshooting Demo Imports

You're trying to setup your theme but you're experiencing errors when importing the demo content? Or you've just followed the setup guide but your website doesn't look exactly like our demo? These are common issues for which you can find easy and quick fixes.

Happy With our Support So Far?

Feel free to review our theme on Themeforest! It helps us making our products more known to new potential customers, which allow us more time to improve the quality and develop new features. #SharingIsCaring ❤️