Changeset 3563 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
- Timestamp:
- 06/23/2016 06:59:17 PM (10 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
r3379 r3563 1318 1318 return ''; 1319 1319 } 1320 return get_post_field( $field, $explanation, $context ); 1320 1321 $post_field = get_post_field( $field, $explanation, $context ); 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; 1321 1337 } 1322 1338
Note: See TracChangeset
for help on using the changeset viewer.