[buddypress-trac] [BuddyPress Trac] #7052: Member visibility in BP_Email and hooked functions
buddypress-trac
noreply at wordpress.org
Thu May 5 21:50:27 UTC 2016
#7052: Member visibility in BP_Email and hooked functions
--------------------------+-----------------------------
Reporter: henry.wright | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: API | Version: 2.5.0
Severity: normal | Keywords:
--------------------------+-----------------------------
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 at example.com', $obj->from->name );
} );
}}}
Perhaps we can relax the visibility of class members?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7052>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list