Changeset 24598 for trunk/wp-includes/post-template.php
- Timestamp:
- 07/09/2013 05:22:50 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-template.php
r24560 r24598 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. 164 */ 165 function the_content( $more_link_text = null, $strip_teaser = false, $id = 0 ) { 166 $post = get_post( $id ); 167 168 /* 169 * Filter: the_content 170 * 171 * param string Post content as returned by get_the_content() 172 * param int The ID of the post to which the content belongs. This was introduced 173 * in 3.6.0 and is not reliably passed by all plugins and themes that 174 * directly apply the_content. As such, it is not considered portable. 175 */ 176 $content = apply_filters( 'the_content', get_the_content( $more_link_text, $strip_teaser, $post->ID ), $post->ID ); 177 echo str_replace( ']]>', ']]>', $content ); 163 */ 164 function the_content( $more_link_text = null, $strip_teaser = false) { 165 $content = get_the_content( $more_link_text, $strip_teaser ); 166 $content = apply_filters( 'the_content', $content ); 167 $content = str_replace( ']]>', ']]>', $content ); 168 echo $content; 178 169 } 179 170 … … 185 176 * @param string $more_link_text Optional. Content for when there is more text. 186 177 * @param bool $stripteaser Optional. Strip teaser content before the more text. Default is false. 187 * @param int $id Optional. A post id. Defaults to the current post when in The Loop, undefined otherwise.188 178 * @return string 189 179 */ 190 function get_the_content( $more_link_text = null, $strip_teaser = false, $id = 0 ) { 191 global $page, $more, $preview; 192 193 $post = get_post( $id ); 194 // Avoid parsing again if the post is the same one parsed by setup_postdata(). 195 // The extract() will set up $pages and $multipage. 196 if ( $post->ID != get_post()->ID ) 197 extract( wp_parse_post_content( $post, false ) ); 198 else 199 global $pages, $multipage; 180 function get_the_content( $more_link_text = null, $strip_teaser = false ) { 181 global $page, $more, $preview, $pages, $multipage; 182 183 $post = get_post(); 200 184 201 185 if ( null === $more_link_text )
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)