Support » Plugin: Events Manager » How to Remove Person's Email from displaying on My Event Bookings Page

  • Hi,

    I’m trying to figure out how to prevent a member’s email address from showing up on the “My Event Bookings” page under the person’s “Personal Details” section. I don’t want Buddypress members having access to other member’s email addresses. Any ideas?

    Thanks!

    https://wordpress.org/plugins/events-manager/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    you can try to modify template file at events-manager/templates/buddypress

    to use templates: http://wp-events-plugin.com/documentation/using-template-files/

    Thread Starter Mark

    (@markob17)

    Hi @gelo_nwl,

    Doesn’t appear the required file is included as a template file. I’ve determined that the file that needs editing to remove the personal details, which is where a user’s email is located, is:
    /wp-content/plugins/events-manager/admin/em-bookings.php

    The two lines of PHP code within that file that render these details are:

    <?php echo $EM_Booking->get_person()->display_summary(); ?>
    <?php echo $EM_Person->display_summary(); ?>

    Do you know how I can prevent these two lines of code from being executed?

    Thanks!

    Mark

    Thread Starter Mark

    (@markob17)

    Hi @gelo_nwl,

    So I found the function that renders the summary info. Looks like there is a filter. Do you know how I can use this filter to disable the get email portion? This would solve my issue. I tried messing with it but don’t have the coding experience. However, I am fairly confident this is the right course of action.

    function display_summary(){
    		ob_start();
    		$no_user = get_option('dbem_bookings_registration_disable') && $this->ID == get_option('dbem_bookings_registration_user');
    		?>
    		<table class="em-form-fields">
    			<tr>
    				<td><?php echo get_avatar($this->ID); ?></td>
    				<td style="padding-left:10px; vertical-align: top;">
    					<table>
    						<?php if( $no_user ): ?>
    						<tr><th><?php _e('Name','events-manager'); ?> : </th><th><?php echo $this->get_name(); ?></th></tr>
    						<?php else: ?>
    						<tr><th><?php _e('Name','events-manager'); ?> : </th><th><a href="<?php echo $this->get_bookings_url(); ?>"><?php echo $this->get_name(); ?></a></th></tr>
    						<?php endif; ?>
    						<tr><th><?php _e('Email','events-manager'); ?> : </th><td><?php echo $this->user_email; ?></td></tr>
    						<tr><th><?php _e('Phone','events-manager'); ?> : </th><td><?php echo esc_html($this->phone); ?></td></tr>
    					</table>
    				</td>
    			</tr>
    		</table>
    		<?php
    		return apply_filters('em_person_display_summary', ob_get_clean(), $this);
    	}

    Regards,

    Mark

    Plugin Support caimin_nwl

    (@caimin_nwl)

    You could try just setting $this->user_email to nothing…

    $this->user_email = '';

    Thread Starter Mark

    (@markob17)

    Hi @caimin_nwl,

    I tried adding that to a filter but not having a coding background I simply could not figure it out. I always get a message “Fatal Error: Using $this when not in object context”. Do you have any more insight into how I can remove the email?

    Thanks,

    mark

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to Remove Person's Email from displaying on My Event Bookings Page’ is closed to new replies.