Ticket #24330: 24330.diff
File 24330.diff, 3.9 KB (added by , 12 years ago) |
---|
-
wp-includes/default-filters.php
136 136 add_filter( 'the_title', 'trim' ); 137 137 add_filter( 'the_title', '_post_formats_title', 10, 2 ); 138 138 139 add_filter( 'the_content', 'post_formats_compat', 7 );139 add_filter( 'the_content', 'post_formats_compat', 7, 2 ); 140 140 add_filter( 'the_content', 'wptexturize' ); 141 141 add_filter( 'the_content', 'convert_smilies' ); 142 142 add_filter( 'the_content', 'convert_chars' ); -
wp-includes/post-template.php
160 160 * 161 161 * @param string $more_link_text Optional. Content for when there is more text. 162 162 * @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false. 163 * @param int $id Optional. A post id. Defaults to the current post when in The Loop, undefined otherwise. 163 164 */ 164 function the_content( $more_link_text = null, $strip_teaser = false ) { 165 $content = apply_filters( 'the_content', get_the_content( $more_link_text, $strip_teaser ) ); 165 function the_content( $more_link_text = null, $strip_teaser = false, $id = 0 ) { 166 $post = get_post( $id ); 167 /* 168 * Filter: the_content 169 * 170 * param string Post content as returned by get_the_content() 171 * param int The ID of the post to which the content belongs. This was introduced 172 * in 3.6.0 and is not reliably passed by all plugins and themes that 173 * directly apply the_content. As such, it is not considered portable. 174 */ 175 $content = apply_filters( 'the_content', get_the_content( $more_link_text, $strip_teaser, $id ), $post->ID ); 166 176 echo str_replace( ']]>', ']]>', $content ); 167 177 } 168 178 … … 173 183 * 174 184 * @param string $more_link_text Optional. Content for when there is more text. 175 185 * @param bool $stripteaser Optional. Strip teaser content before the more text. Default is false. 186 * @param int $id Optional. A post id. Defaults to the current post when in The Loop, undefined otherwise. 176 187 * @return string 177 188 */ 178 function get_the_content( $more_link_text = null, $strip_teaser = false ) {189 function get_the_content( $more_link_text = null, $strip_teaser = false, $id = 0 ) { 179 190 global $more, $page, $pages, $multipage, $preview; 180 191 181 $post = get_post( );192 $post = get_post( $id ); 182 193 183 194 if ( null === $more_link_text ) 184 195 $more_link_text = __( '(more…)' ); … … 187 198 $has_teaser = false; 188 199 189 200 // If post password required and it doesn't match the cookie. 190 if ( post_password_required( ) )201 if ( post_password_required( $post ) ) 191 202 return get_the_password_form(); 192 203 193 204 if ( $page > count( $pages ) ) // if the requested page doesn't exist … … 1225 1236 * 1226 1237 * @since 1.0.0 1227 1238 * @uses apply_filters() Calls 'the_password_form' filter on output. 1228 * 1239 * @param int $id Optional. A post id. Defaults to the current post when in The Loop, undefined otherwise. 1229 1240 * @return string HTML content for password form for password protected post. 1230 1241 */ 1231 function get_the_password_form( ) {1242 function get_the_password_form( $id = 0 ) { 1232 1243 $post = get_post(); 1233 1244 $label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID ); 1234 1245 $output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post"> -
wp-includes/comment.php
1749 1749 } 1750 1750 1751 1751 if ( empty($post->post_excerpt) ) 1752 $excerpt = apply_filters('the_content', $post->post_content );1752 $excerpt = apply_filters('the_content', $post->post_content, $post->ID); 1753 1753 else 1754 1754 $excerpt = apply_filters('the_excerpt', $post->post_excerpt); 1755 1755 $excerpt = str_replace(']]>', ']]>', $excerpt);