[wp-trac] [WordPress Trac] #44376: Make $email_data array filterable in `wp_send_user_request()`

WordPress Trac noreply at wordpress.org
Fri Jun 15 18:43:20 UTC 2018


#44376: Make $email_data array filterable in `wp_send_user_request()`
-------------------------+-----------------------------
 Reporter:  rwebster85   |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Privacy      |    Version:  4.9.6
 Severity:  normal       |   Keywords:
  Focuses:  privacy      |
-------------------------+-----------------------------
 It would be very handy for developers if we could hook into the
 `$email_data` array and filter it. That way we could replace the url or
 other parameters. Real world example: my site blocks access to all WP
 dashboard and backend pages like `wp-login.php` in order to present a
 front-end only experience to users. I would like my privacy related
 request authorisation links to be front-end also.

 `$email_data` as seen here:
 https://github.com/WordPress/WordPress/blob/3ee58b55b14683af4c568bce1845c37408c88fbb
 /wp-includes/user.php#L3329

 Something like the following would be good:

 {{{#!php
 $email_data = array(
         'email'       => $request->email,
         'description' => wp_user_request_action_description(
 $request->action_name ),
         'confirm_url' => add_query_arg( array(
                 'action'      => 'confirmaction',
                 'request_id'  => $request_id,
                 'confirm_key' => wp_generate_user_request_key( $request_id
 ),
         ), site_url( 'wp-login.php' ) ),
         'sitename'    => is_multisite() ? get_site_option( 'site_name' ) :
 get_option( 'blogname' ),
         'siteurl'     => network_home_url(),
 );

 $email_data = apply_filters( 'wp_send_user_request_email_data',
 $email_data, $request, $request_id );
 }}}

 Note: My first ticket, apologies for any errors in submission.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44376>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list