Changeset 24301 for trunk/wp-includes/post-formats.php
- Timestamp:
- 05/20/2013 11:05:50 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post-formats.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-formats.php
r24249 r24301 867 867 * @param string $more_link_text Optional. Content for when there is more text. 868 868 * @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false. 869 * @param int $id Optional. A post id. Defaults to the current post when in The Loop, undefined otherwise. 869 870 * @return string The content minus the extracted post format content. 870 871 */ 871 function get_the_remaining_content( $more_link_text = null, $strip_teaser = false ) { 872 global $more, $page, $format_pages, $multipage, $preview; 873 874 $post = get_post(); 872 function get_the_remaining_content( $more_link_text = null, $strip_teaser = false, $id = 0 ) { 873 global $more, $page, $preview; 874 875 $post = get_post( $id ); 876 877 extract( wp_parse_post_content( $post, true ) ); 875 878 876 879 if ( null === $more_link_text ) … … 881 884 882 885 // If post password required and it doesn't match the cookie. 883 if ( post_password_required( ) )884 return get_the_password_form( );885 886 if ( $page > count( $ format_pages ) ) // if the requested page doesn't exist887 $page = count( $ format_pages ); // give them the highest numbered page that DOES exist888 889 $content = $ format_pages[$page-1];886 if ( post_password_required( $post ) ) 887 return get_the_password_form( $post ); 888 889 if ( $page > count( $pages ) ) // if the requested page doesn't exist 890 $page = count( $pages ); // give them the highest numbered page that DOES exist 891 892 $content = $pages[$page-1]; 890 893 if ( preg_match( '/<!--more(.*?)?-->/', $content, $matches ) ) { 891 894 $content = explode( $matches[0], $content, 2 ); … … 932 935 * @param string $more_link_text Optional. Content for when there is more text. 933 936 * @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false. 934 */ 935 function the_remaining_content( $more_link_text = null, $strip_teaser = false ) { 936 $extra = get_the_remaining_content( $more_link_text, $strip_teaser ); 937 * @param int $id Optional. A post id. Defaults to the current post when in The Loop, undefined otherwise. 938 */ 939 function the_remaining_content( $more_link_text = null, $strip_teaser = false, $id = 0 ) { 940 $post = get_post( $id ); 941 942 $extra = get_the_remaining_content( $more_link_text, $strip_teaser, $post->ID ); 937 943 938 944 remove_filter( 'the_content', 'post_formats_compat', 7 ); 939 $content = apply_filters( 'the_content', $extra );940 add_filter( 'the_content', 'post_formats_compat', 7 );945 $content = apply_filters( 'the_content', $extra, $post->ID ); 946 add_filter( 'the_content', 'post_formats_compat', 7, 2 ); 941 947 942 948 echo str_replace( ']]>', ']]>', $content );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)