Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#7052 closed defect (bug) (no action required)

Member visibility in BP_Email and hooked functions

Reported by: henrywright's profile henry.wright Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.5.0
Component: Core Keywords:
Cc:

Description

The bp_email action gives us the BP_Email object to use in our hooked functions:

do_action( 'bp_email', $email_type, $this );

The problem is, most of the BP_Email class properties are protected, so we can't actually use them outside the class:

// Doesn't work because BP_Email::$from is protected.
add_action( 'bp_email', function( $type, $obj ) {
    $obj->set_from( 'user@example.com', $obj->from->name );
} );

Perhaps we can relax the visibility of class members?

Change History (2)

#1 @henry.wright
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

I completely overlooked BP_Email::get().

I'll close this.

#2 @DJPaul
8 years ago

  • Component changed from API to Core
Note: See TracTickets for help on using tickets.