#7052 closed defect (bug) (no action required)
Member visibility in BP_Email and hooked functions
| Reported by: |
|
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)
Note: See
TracTickets for help on using
tickets.
I completely overlooked
BP_Email::get().I'll close this.