[wp-trac] [WordPress Trac] #34669: Custom back_link in wp_die and provide a filter

WordPress Trac noreply at wordpress.org
Tue Sep 13 19:23:57 UTC 2022


#34669: Custom back_link in wp_die and provide a filter
-------------------------+-----------------------
 Reporter:  eventualo    |       Owner:  (none)
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  6.1
Component:  General      |     Version:  4.4
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+-----------------------

Comment (by hellofromTonya):

 @desrosj while the patch [attachment:"34669.2.diff"] makes the args
 filterable, `'back_link'` is used as a flag (i.e. boolean). If I'm
 understanding @eventualo's request, they are looking for a filter to
 modify the `href` attribute in back link:

 Current code is this:
 {{{#!php
 if ( isset( $parsed_args['back_link'] ) && $parsed_args['back_link'] ) {
         $back_text = $have_gettext ? __( '« Back' ) : '«
 Back';
         $message  .= "\n<p><a
 href='javascript:history.back()'>$back_text</a></p>";
 }
 }}}

 I agree with you @desrosj about the proposed implementation and
 `history.back()`.

 But I'm questioning the need for an args filter. Why? The reporter noted
 they are invoking `wp_die()` in their plugin and passing the args to it,
 meaning they won't use the new args filter.

 What do you think, Jon?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/34669#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list