Ticket #31373: 31373.5.patch
File 31373.5.patch, 4.8 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/class-wp-press-this.php
52 52 * 53 53 * @param bool $redir_in_parent Whether to redirect in parent window or not. Default false. 54 54 */ 55 'redir_in_parent' => apply_filters( 'press_this_redirect_in_parent', __return_false()),55 'redir_in_parent' => apply_filters( 'press_this_redirect_in_parent', false ), 56 56 ); 57 57 } 58 58 … … 377 377 $data['_meta'] = array(); 378 378 } 379 379 380 if ( preg_match_all( '/<meta ([^>]+)[\s]?\/?>/ 380 if ( preg_match_all( '/<meta ([^>]+)[\s]?\/?>/', $source_content, $matches ) ) { 381 381 if ( ! empty( $matches[0] ) ) { 382 382 foreach ( $matches[0] as $key => $value ) { 383 383 if ( preg_match( '/<meta[^>]+(property|name)="(.+)"[^>]+content="(.+)"/', $value, $new_matches ) ) { … … 665 665 * @access public 666 666 */ 667 667 public function html() { 668 global $wp_locale , $hook_suffix;668 global $wp_locale; 669 669 670 670 // Get data, new (POST) and old (GET). 671 671 $data = $this->merge_or_fetch_data(); … … 698 698 <title><?php esc_html_e( 'Press This!' ) ?></title> 699 699 700 700 <script> 701 window.wpPressThisData = <?php echo json_encode( $data ) ?>;702 window.wpPressThisConfig = <?php echo json_encode( $site_settings ) ?>;701 window.wpPressThisData = <?php echo wp_json_encode( $data ) ?>; 702 window.wpPressThisConfig = <?php echo wp_json_encode( $site_settings ) ?>; 703 703 </script> 704 704 705 705 <script type="text/javascript"> … … 738 738 } 739 739 740 740 /** This action is documented in wp-admin/admin-header.php */ 741 do_action( 'admin_enqueue_scripts', $hook_suffix);741 do_action( 'admin_enqueue_scripts', 'press-this.php' ); 742 742 743 /** 744 * Fires when styles are printed for the Press This admin page. 745 * 746 * @since 3.7.0 747 */ 748 do_action( 'admin_print_styles-press-this.php' ); 749 743 750 /** This action is documented in wp-admin/admin-header.php */ 744 751 do_action( 'admin_print_styles' ); 745 752 753 /** 754 * Fires when scripts are printed for the Press This admin page. 755 * 756 * @since 3.7.0 757 */ 758 do_action( 'admin_print_scripts-press-this.php' ); 759 746 760 /** This action is documented in wp-admin/admin-header.php */ 747 761 do_action( 'admin_print_scripts' ); 748 762 763 /** 764 * Fires in the head tag on the Press This admin page. 765 * 766 * @since 3.7.0 767 */ 768 do_action( 'admin_head-press-this.php' ); 769 770 /** This action is documented in wp-admin/admin-header.php */ 771 do_action( 'admin_head' ); 749 772 ?> 750 773 </head> 751 <body> 774 <?php 775 $admin_body_class = ( is_rtl() ) ? 'rtl' : ''; 776 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 777 ?> 778 <body class="press-this <?php echo $admin_body_class; ?>"> 752 779 <div id="adminbar" class="adminbar"> 753 780 <h1 id="current-site" class="current-site"> 754 781 <span class="dashicons dashicons-wordpress"></span> -
src/wp-includes/script-loader.php
473 473 $scripts->add( 'press-this', "/wp-admin/js/press-this$suffix.js", array( 'jquery', 'tags-box' ), false, 1 ); 474 474 did_action( 'init' ) && $scripts->localize( 'press-this', 'pressThisL10n', array( 475 475 /** 476 * press_this_source_string: string displayed before the source attribution string, defaults to "Source:".476 * Filter the string displayed before the source attribution string. 477 477 * 478 * @since 4.2 479 * @see https://github.com/MichaelArestad/Press-This/issues/25 478 * @since 4.2.0 480 479 * 481 * @param string $string Internationalized source string 482 * 483 * @return string Source string 480 * @param string $string Internationalized source string. 484 481 */ 485 482 'source' => apply_filters( 'press_this_source_string', __( 'Source:' ) ), 486 483 487 484 /** 488 * press_this_source_link: HTML link format for the source attribution, can control target, class, etc485 * Filter the HTML link format for the source attribution, can control target, class, etc. 489 486 * 490 * @since 4.2 491 * @see https://github.com/MichaelArestad/Press-This/issues/25 487 * @since 4.2.0 492 488 * 493 * @param string $link_format Internationalized link format, %1$s is link href, %2$s is link text 494 * 495 * @return string Link markup 489 * @param string $link_format Link format, %1$s is link href, %2$s is link text 496 490 */ 497 'sourceLink' => apply_filters( 'press_this_source_link', __( '<a href="%1$s">%2$s</a>' )),491 'sourceLink' => apply_filters( 'press_this_source_link', '<a href="%1$s">%2$s</a>' ), 498 492 'newPost' => __( 'Title' ), 499 493 'unexpectedError' => __( 'Sorry, but an unexpected error occurred.' ), 500 494 'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),