WordPress.org

Make WordPress Core

Changeset 31894


Ignore:
Timestamp:
03/26/2015 01:16:58 AM (4 years ago)
Author:
azaozz
Message:

Press This: on sites that support oEmbed, if the user has selected some text, quote it below the embed.
Props stephdau. Fixes #31763.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-press-this.php

    r31868 r31894  
    10101010        if ( ! empty( $data['u'] ) && $oembed->get_provider( $data['u'], array( 'discover' => false ) ) ) {
    10111011            $default_html['embed'] = '<p>[embed]' . $data['u'] . '[/embed]</p>';
     1012
     1013            if ( ! empty( $data['s'] ) ) {
     1014                // If the user has selected some text, do quote it.
     1015                $default_html['quote'] = '<blockquote>%1$s</blockquote>';
     1016            }
    10121017        } else {
    10131018            $default_html['quote'] = '<blockquote>%1$s</blockquote>';
     
    10311036
    10321037        // Wrap suggested content in the specified HTML.
    1033         if ( ! empty( $default_html['quote'] ) ) {
     1038        if ( ! empty( $default_html['quote'] ) && $text ) {
    10341039            $content .= sprintf( $default_html['quote'], $text );
    10351040        }
Note: See TracChangeset for help on using the changeset viewer.