Make WordPress Core

Ticket #31493: 31493.4.patch

File 31493.4.patch, 2.8 KB (added by kraftbj, 12 years ago)

Same as .3 except default to em instead of cite and removes unintentional inclusion of testing code from hello.php

  • src/wp-admin/includes/class-wp-press-this.php

     
    3131         * @return array Site settings.
    3232         */
    3333        public function site_settings() {
    34                 $html = '<p class="press-this-suggested-source">' . _x( 'Source:', 'Used in Press This to indicate where the content comes from.' ) .
    35                         ' <cite><a href="%1$s">%2$s</a></cite></p>';
     34                $default_html = '<blockquote>%1$s</blockquote>';
    3635
     36                $source_html = '<p>' . _x( 'Source:', 'Used in Press This to indicate where the content comes from.' ) .
     37                        ' <em><a href="%1$s">%2$s</a></em></p>';
     38
    3739                return array(
    3840                        // Used to trigger the bookmarklet update notice.
    3941                        // Needs to be set here and in get_shortcut_link() in wp-includes/link-template.php.
    … …  
    4951                        'redirInParent' => apply_filters( 'press_this_redirect_in_parent', false ),
    5052
    5153                        /**
     54                         * Filter the HTML for the Press This blockquote.
     55                         *
     56                         * @since 4.2.0
     57                         *
     58                         * @param string $default_html Default HTML, %1$s is quoted text.
     59                         */
     60                        'suggestedDefault' => apply_filters( 'press_this_suggested_default_html', $default_html ),
     61
     62                        /**
    5263                         * Filter the HTML for the Press This source attribution.
    5364                         *
    5465                         * @since 4.2.0
    … …  
    5566                         *
    5667                         * @param string $html Default HTML, %1$s is link href, %2$s is link text.
    5768                         */
    58                         'suggestedHTML' => apply_filters( 'press_this_suggested_html', $html ),
     69                        'suggestedSource' => apply_filters( 'press_this_suggested_source_html', $source_html ),
     70
    5971                );
    6072        }
    6173
  • src/wp-admin/js/press-this.js

     
    200200                                }
    201201                        }
    202202
    203                         if ( text ) {
    204                                 text = sanitizeText( text );
    205                                 // Wrap suggested content in blockquote tag.
    206                                 content = '<blockquote class="press-this-suggested-content">' + text + '</blockquote>';
     203                        if ( text && siteConfig.suggestedDefault ) {
     204                                // Wrap suggested content in specified HTML.
     205                                content = siteConfig.suggestedDefault.replace( /%1\$s/g, sanitizeText( text ) );
    207206                        }
    208207
    209208                        // Add a source attribution if there is one available.
    210                         if ( url && siteConfig.suggestedHTML && ( ( title && __( 'newPost' ) !== title ) || siteName ) ) {
    211                                 content += siteConfig.suggestedHTML.replace( /%1\$s/g, encodeURI( url ) ).replace( /%2\$s/g, ( title || siteName ) );
     209                        if ( url && siteConfig.suggestedSource && ( ( title && __( 'newPost' ) !== title ) || siteName ) ) {
     210                                content += siteConfig.suggestedSource.replace( /%1\$s/g, encodeURI( url ) ).replace( /%2\$s/g, ( title || siteName ) );
    212211                        }
    213212
    214213                        return content || '';