Make WordPress Core

Changeset 31836


Ignore:
Timestamp:
03/20/2015 12:18:00 AM (9 years ago)
Author:
azaozz
Message:

Press This: small clean-up when generating the suggested content. Ensure all keys are always set in the array that is passed through the filter.
See #31637.

File:
1 edited

Legend:

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

    r31827 r31836  
    10031003        }
    10041004
     1005        $default_html = array( 'quote' => '', 'link' => '', 'embed' => '' );
     1006
    10051007        require_once( ABSPATH . WPINC . '/class-oembed.php' );
    10061008        $oembed = _wp_oembed_get_object();
    10071009
    10081010        if ( ! empty( $data['u'] ) && $oembed->get_provider( $data['u'], array( 'discover' => false ) ) ) {
    1009             $default_html = array(
    1010                 'quote' => '',
    1011                 'link' => '',
    1012                 'embed' => '<p>[embed]' . $data['u'] . '[/embed]</p>',
    1013             );
     1011            $default_html['embed'] = '<p>[embed]' . $data['u'] . '[/embed]</p>';
    10141012        } else {
    1015             $default_html = array(
    1016                 'quote' => '<blockquote>%1$s</blockquote>',
    1017                 'link' => '<p>' . _x( 'Source:', 'Used in Press This to indicate where the content comes from.' ) .
    1018                     ' <em><a href="%1$s">%2$s</a></em></p>',
    1019             );
     1013            $default_html['quote'] = '<blockquote>%1$s</blockquote>';
     1014            $default_html['link'] = '<p>' . _x( 'Source:', 'Used in Press This to indicate where the content comes from.' ) .
     1015                ' <em><a href="%1$s">%2$s</a></em></p>';
    10201016        }
    10211017
Note: See TracChangeset for help on using the changeset viewer.