Ticket #31493: 31493.3.patch
| File 31493.3.patch, 3.2 KB (added by , 12 years ago) |
|---|
-
src/wp-admin/includes/class-wp-press-this.php
31 31 * @return array Site settings. 32 32 */ 33 33 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.' ) . 34 $default_html = '<blockquote>%1$s</blockquote>'; 35 36 $source_html = '<p>' . _x( 'Source:', 'Used in Press This to indicate where the content comes from.' ) . 35 37 ' <cite><a href="%1$s">%2$s</a></cite></p>'; 36 38 37 39 return array( … … 49 51 'redirInParent' => apply_filters( 'press_this_redirect_in_parent', false ), 50 52 51 53 /** 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 /** 52 63 * Filter the HTML for the Press This source attribution. 53 64 * 54 65 * @since 4.2.0 … … 55 66 * 56 67 * @param string $html Default HTML, %1$s is link href, %2$s is link text. 57 68 */ 58 'suggestedHTML' => apply_filters( 'press_this_suggested_html', $html ), 69 'suggestedSource' => apply_filters( 'press_this_suggested_source_html', $source_html ), 70 59 71 ); 60 72 } 61 73 -
src/wp-admin/js/press-this.js
200 200 } 201 201 } 202 202 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 ) ); 207 206 } 208 207 209 208 // Add a source attribution if there is one available. 210 if ( url && siteConfig.suggested HTML&& ( ( title && __( 'newPost' ) !== title ) || siteName ) ) {211 content += siteConfig.suggested HTML.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 ) ); 212 211 } 213 212 214 213 return content || ''; -
src/wp-content/plugins/hello.php
12 12 Author URI: http://ma.tt/ 13 13 */ 14 14 15 add_filter( 'press_this_suggested_default_html', 'bk_test_1' ); 16 function bk_test_1() { 17 $default_html = ''; 18 return $default_html; 19 } 20 21 add_filter( 'press_this_suggested_source_html', 'bk_test_2' ); 22 function bk_test_2() { 23 $source_html = '<a href="%1$s">%2$s</a>'; 24 return $source_html; 25 } 26 27 15 28 function hello_dolly_get_lyric() { 16 29 /** These are the lyrics to Hello Dolly */ 17 30 $lyrics = "Hello, Dolly
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)