Changeset 23876
- Timestamp:
- 03/29/2013 09:06:37 PM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-formats.php
r23847 r23876 418 418 419 419 /** 420 * Add chat detection support to the `get_content_chat()` chat parser 420 * Add chat detection support to the `get_content_chat()` chat parser. 421 421 * 422 422 * @since 3.6.0 … … 485 485 return array(); 486 486 487 $has_match = false;488 487 $matched_parser = false; 489 488 foreach ( $_wp_chat_parsers as $parser ) { 490 @list( $newline_regex ) = $parser;489 @list( $newline_regex, $delimiter_regex ) = $parser; 491 490 if ( preg_match( $newline_regex, $trimmed ) ) { 492 $has_match = true;493 491 $matched_parser = $parser; 494 492 break; … … 499 497 return array(); 500 498 501 @list( $newline_regex, $delimiter_regex ) = $parser;502 503 499 $last_index = 0; 504 $stanzas = array(); 500 $stanzas = $data = $stanza = array(); 501 $author = $time = ''; 505 502 $lines = explode( "\n", make_clickable( $trimmed ) ); 506 503 507 $author = $time = '';508 $data = array();509 $stanza = array();510 504 511 505 foreach ( $lines as $index => $line ) { … … 515 509 if ( ! empty( $author ) ) { 516 510 $stanza[] = array( 517 'time' => $time,518 'author' => $author,511 'time' => $time, 512 'author' => $author, 519 513 'message' => join( ' ', $data ) 520 514 ); … … 523 517 $stanzas[] = $stanza; 524 518 $last_index = $index; 525 $stanza = array();519 $stanza = $data = array(); 526 520 $author = $time = ''; 527 $data = array();528 521 if ( ! empty( $lines[$index + 1] ) && ! preg_match( $delimiter_regex, $lines[$index + 1] ) ) 529 522 break; … … 540 533 if ( ! empty( $author ) ) { 541 534 $stanza[] = array( 542 'time' => $time,543 'author' => $author,535 'time' => $time, 536 'author' => $author, 544 537 'message' => join( ' ', $data ) 545 538 ); … … 557 550 if ( ! empty( $author ) ) { 558 551 $stanza[] = array( 559 'time' => $time,560 'author' => $author,552 'time' => $time, 553 'author' => $author, 561 554 'message' => trim( join( ' ', $data ) ) 562 555 ); … … 603 596 */ 604 597 function the_chat() { 605 $output = '<dl class="chat-transcript">'; 606 598 $output = '<dl class="chat">'; 607 599 $stanzas = get_the_chat(); 608 600 … … 611 603 $time = ''; 612 604 if ( ! empty( $row['time'] ) ) 613 $time = sprintf( '<time >%s</time>', esc_html( $row['time'] ) );605 $time = sprintf( '<time class="chat-timestamp">%s</time>', esc_html( $row['time'] ) ); 614 606 615 607 $output .= sprintf( … … 617 609 <dd class="chat-text">%4$s</dd> 618 610 ', 619 esc_attr( s trtolower( $row['author'] ) ), // Slug.611 esc_attr( sanitize_title_with_dashes( $row['author'] ) ), // Slug. 620 612 $time, 621 613 esc_html( $row['author'] ), 622 esc_html( $row['message'] )614 $row['message'] 623 615 ); 624 616 } 625 617 } 626 618 627 $output .= '</dl><!-- .chat -transcript-->';619 $output .= '</dl><!-- .chat -->'; 628 620 629 621 echo $output; -
trunk/wp-includes/query.php
r23819 r23876 3627 3627 * @since 3.6.0 3628 3628 * 3629 * @param string $content Content to split 3630 * @return array Paged content 3629 * @param string $content Content to split. 3630 * @return array Paged content. 3631 3631 */ 3632 3632 function paginate_content( $content ) { 3633 3633 $content = str_replace( "\n<!--nextpage-->\n", '<!--nextpage-->', $content ); 3634 $content = str_replace( "\n<!--nextpage-->", '<!--nextpage-->', $content );3635 $content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );3636 return explode( '<!--nextpage-->', $content );3634 $content = str_replace( "\n<!--nextpage-->", '<!--nextpage-->', $content ); 3635 $content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content ); 3636 return explode( '<!--nextpage-->', $content ); 3637 3637 } 3638 3638 … … 3643 3643 * 3644 3644 * @param string $content 3645 * @param int $paged 3645 3646 * @return string 3646 3647 */ 3647 function get_paged_content( $content = null, $paged = null) {3648 function get_paged_content( $content = '', $paged = 0 ) { 3648 3649 global $page; 3649 3650 if ( empty( $page ) ) … … 3656 3657 $post = get_post(); 3657 3658 if ( empty( $post ) ) 3658 return ;3659 return ''; 3659 3660 3660 3661 $content = $post->post_content;
Note: See TracChangeset
for help on using the changeset viewer.