[wp-trac] [WordPress Trac] #34455: Additional Filters for Press This

WordPress Trac noreply at wordpress.org
Thu Mar 3 20:15:46 UTC 2016


#34455: Additional Filters for Press This
--------------------------+-----------------------
 Reporter:  cadeyrn       |       Owner:  kraftbj
     Type:  defect (bug)  |      Status:  reopened
 Priority:  high          |   Milestone:  4.5
Component:  Press This    |     Version:  4.2
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------

Comment (by azaozz):

 Replying to [comment:20 cadeyrn]:
 > I can't find any filter for the `$text` variable in
 `get_suggested_content`.

 The `press_this_suggested_html` filter lets you modify (or remove) the
 HTML tags. Then `sprintf()` is used to add the content at the specified
 places in the modified strings. I'm not sure how exactly you're trying to
 use this, but to get only the `$text` variable in the content you can do:

 {{{
 add_filter( 'press_this_suggested_html', 'my_press_this_content' );
 function my_press_this_content( $array ) {
     return array( 'quote' => '%s' );
 }
 }}}

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


More information about the wp-trac mailing list