Ticket #29014: post-template.php.patch
File post-template.php.patch, 4.8 KB (added by , 11 years ago) |
---|
-
post-template.php
41 41 * @return null|string Null on no title. String if $echo parameter is false. 42 42 */ 43 43 function the_title($before = '', $after = '', $echo = true) { 44 $post = get_post(); 44 45 $title = get_the_title(); 45 46 46 47 if ( strlen($title) == 0 ) … … 48 49 49 50 $title = $before . $title . $after; 50 51 52 /** 53 * Filter the displayed post title. 54 * 55 * @since 0.72 56 * 57 * @param string $post_title The post title. 58 * @param int $poat_id The post id. 59 */ 60 $title = apply_filters( 'the_title', $title, $post->ID ); 61 62 /** 63 * Filter the displayed post title for a custom post type. 64 * 65 * @since 4.0 66 * 67 * @param string $post_title The post title. 68 * @param int $poat_id The post id. 69 */ 70 $title = apply_filters( "the_title_{$post->post_type}", $title, $post->ID ); 71 51 72 if ( $echo ) 52 73 echo $title; 53 74 else … … 149 170 } 150 171 151 172 /** 152 * Filter the post title.173 * Filter the retrieved post title. 153 174 * 154 * @since 0.71175 * @since 4.0 155 176 * 156 * @param string $ title The post title.157 * @param int $ id The post ID.177 * @param string $post_title The post title. 178 * @param int $poat_id The post id. 158 179 */ 159 return apply_filters( 'the_title', $title, $id ); 180 $title = apply_filters( 'get_the_title', $title, $post->ID ); 181 182 /** 183 * Filter the retrieved post title for a custom post type. 184 * 185 * @since 4.0 186 * 187 * @param string $post_title The post title. 188 * @param int $poat_id The post id. 189 */ 190 $title = apply_filters( "get_the_title_{$post->post_type}", $title, $post->ID ); 191 192 return $title; 160 193 } 161 194 162 195 /** … … 210 243 * @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false. 211 244 */ 212 245 function the_content( $more_link_text = null, $strip_teaser = false) { 246 $post = get_post(); 213 247 $content = get_the_content( $more_link_text, $strip_teaser ); 214 248 215 249 /** 216 * Filter the post content.250 * Filter the displayed post content. 217 251 * 218 252 * @since 0.71 219 253 * 220 * @param string $content Content of the current post. 254 * @param string $post_content The post content. 255 * @param int $poat_id The post id. 221 256 */ 222 $content = apply_filters( 'the_content', $content ); 257 $content = apply_filters( 'the_content', $content, $post->ID ); 258 259 /** 260 * Filter the displayed post content for a custom post type. 261 * 262 * @since 4.0 263 * 264 * @param string $post_content The post content. 265 * @param int $poat_id The post id. 266 */ 267 $content = apply_filters( "the_content_{$post->post_type}", $content, $post->ID ); 223 268 $content = str_replace( ']]>', ']]>', $content ); 224 269 echo $content; 225 270 } … … 294 339 if ( $preview ) // preview fix for javascript bug with foreign languages 295 340 $output = preg_replace_callback( '/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output ); 296 341 342 /** 343 * Filter the retrieved post content. 344 * 345 * @since 4.0 346 * 347 * @param string $post_content The post content. 348 * @param int $poat_id The post id. 349 */ 350 $output = apply_filters( 'get_the_content', $output, $post->ID ); 351 352 /** 353 * Filter the retrieved post content for a custom post type. 354 * 355 * @since 4.0 356 * 357 * @param string $post_content The post content. 358 * @param int $poat_id The post id. 359 */ 360 $output = apply_filters( "get_the_content_{$post->post_type}", $output, $post->ID ); 361 297 362 return $output; 298 363 } 299 364 … … 315 380 * @since 0.71 316 381 */ 317 382 function the_excerpt() { 383 $post = get_post(); 318 384 319 385 /** 320 386 * Filter the displayed post excerpt. 321 387 * 322 * @since 0.71388 * @since 1.2.0 323 389 * 324 * @see get_the_excerpt() 390 * @param string $post_excerpt The post excerpt. 391 * @param int $poat_id The post id. 392 */ 393 $excerpt = apply_filters( 'the_excerpt', get_the_excerpt(), $post->ID ); 394 395 /** 396 * Filter the displayed post excerpt for a custom post type. 325 397 * 398 * @since 4.0 399 * 326 400 * @param string $post_excerpt The post excerpt. 401 * @param int $poat_id The post id. 327 402 */ 328 echo apply_filters( 'the_excerpt', get_the_excerpt() ); 403 $excerpt = apply_filters( "the_excerpt_{$post->post_type}", get_the_excerpt(), $post->ID ); 404 405 echo $excerpt; 329 406 } 330 407 331 408 /** … … 355 432 * @since 1.2.0 356 433 * 357 434 * @param string $post_excerpt The post excerpt. 435 * @param int $poat_id The post id. 358 436 */ 359 return apply_filters( 'get_the_excerpt', $post->post_excerpt ); 437 $excerpt = apply_filters( 'get_the_excerpt', $post->post_excerpt, $post->ID ); 438 439 /** 440 * Filter the retrieved post excerpt for a custom post type. 441 * 442 * @since 4.0 443 * 444 * @param string $post_excerpt The post excerpt. 445 * @param int $poat_id The post id. 446 */ 447 $excerpt = apply_filters( "get_the_excerpt_{$post->post_type}", $post->post_excerpt, $post->ID ); 448 449 return $excerpt; 360 450 } 361 451 362 452 /**