Changeset 3626 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
- Timestamp:
- 07/06/2016 07:16:58 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
r3563 r3626 550 550 $delimiter = false !== strpos( $signature, '$' ) ? '"' : "'"; 551 551 $signature = $delimiter . $signature . $delimiter; 552 $signature = '<span class="hook-func">' . $hook_type . '</span> 552 $signature = '<span class="hook-func">' . $hook_type . '</span>( ' . $signature; 553 553 if ( $hook_args ) { 554 554 $signature .= ', '; … … 580 580 } 581 581 582 $signature .= ' 582 $signature .= '('; 583 583 if ( $args = implode( ', ', $args_strings ) ) { 584 584 $signature .= $args . ' '; … … 1321 1321 $post_field = get_post_field( $field, $explanation, $context ); 1322 1322 1323 // If retrieving the explanation content for display, add the TOC if available. 1324 if ( 'post_content' === $field && 'display' === $context ) { 1325 if ( class_exists( 'WPorg_Handbook_TOC' ) ) : 1326 $TOC = new \WPorg_Handbook_TOC( get_parsed_post_types() ); 1327 1328 add_filter( 'the_content', array( $TOC, 'add_toc' ) ); 1329 $post_field = apply_filters( 'the_content', apply_filters( 'get_the_content', $post_field ) ); 1330 remove_filter( 'the_content', array( $TOC, 'add_toc' ) ); 1331 else : 1332 $post_field = apply_filters( 'the_content', apply_filters( 'get_the_content', $post_field ) ); 1333 endif; 1334 } 1335 1336 return $post_field; 1323 return apply_filters( 'the_content', apply_filters( 'get_the_content', $post_field ) ); 1337 1324 } 1338 1325 … … 1440 1427 echo $form; 1441 1428 } 1429 1430 /** 1431 * Retrieves all content for reference template parts. 1432 * 1433 * @return string Template part markup retrieved via output buffering. 1434 */ 1435 function get_reference_template_parts() { 1436 // Order dictates order of display. 1437 $templates = array( 1438 'description', 1439 'params', 1440 'return', 1441 'source', 1442 'changelog', 1443 'explanation', 1444 'related', 1445 'methods', 1446 'notes' 1447 ); 1448 1449 ob_start(); 1450 1451 foreach ( $templates as $part ) { 1452 get_template_part( 'reference/template', $part ); 1453 } 1454 1455 return ob_get_clean(); 1456 } 1442 1457 } 1443
Note: See TracChangeset
for help on using the changeset viewer.