Ticket #454: meta-454.patch
File meta-454.patch, 2.0 KB (added by , 9 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-reference.php
27 27 $source_file = get_source_file(); 28 28 if ( ! empty( $source_file ) ) : ?> 29 29 <section class="source"> 30 <p><strong><?php _e( 'Source:', 'wporg' ); ?></strong> <a href="<?php echo get_source_file_link( $source_file ); ?>"><?php echo esc_html( $source_file ); ?></a></p> 30 <p> 31 <strong><?php _e( 'Source:', 'wporg' ); ?></strong> 32 <a href="<?php echo get_source_file_link( $source_file ); ?>"><?php echo esc_html( $source_file ); ?></a> 33 (<a href="<?php echo get_source_file_trac_link( $source_file ); ?>"><?php _e( 'Browse in Trac', 'wporg' ); ?></a>) 34 </p> 31 35 </section> 32 36 <?php endif; ?> 33 37 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
532 532 } 533 533 534 534 /** 535 * Retrieve URL to source file in Trac 536 * 537 * @param string $name 538 * 539 * @return string 540 */ 541 function get_source_file_trac_link( $name = null ) { 542 543 $trac_browser_url = 'https://core.trac.wordpress.org/browser/trunk/src/'; 544 $source_file_object = wp_get_post_terms( empty( $post_id ) ? get_the_ID() : $post_id, 'wp-parser-source-file', array( 'fields' => 'names' ) ); 545 546 return empty( $source_file_object ) ? '' : esc_url( $trac_browser_url . $source_file_object[0] ); 547 } 548 549 /** 535 550 * Retrieve name of source file 536 551 * 537 552 * @param int $post_id