Making WordPress.org

Changeset 11311

Timestamp:
11/04/2021 03:25:50 AM (3 years ago)
Author:
dd32
Message:

Code Reference: Include a link to view the source on GitHub.

Props stuartshields, netweb, dd32.
Fixes #5942.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php

    r10000 r11311  
    11591159     *
    11601160     * @param null $post_id     Post ID.
    1161      * @param bool $line_number Whether to append the line number to the URL.
    1162      *                          Default true.
    11631161     * @return string Source file URL with or without line number.
    11641162     */
    1165     function get_source_file_link( $post_id = null, $line_number = true ) {
     1163    function get_source_file_link( $post_id = null ) {
    11661164
    11671165        $post_id = empty( $post_id ) ? get_the_ID() : $post_id;
     
    11751173            if ( $line_number = get_post_meta( get_the_ID(), '_wp-parser_line_num', true ) ) {
    11761174                $url .= "#L{$line_number}";
     1175
     1176
     1177
     1178
     1179
     1180
     1181
     1182
     1183
     1184
     1185
     1186
     1187
     1188
     1189
     1190
     1191
     1192
     1193
     1194
     1195
     1196
     1197
     1198
     1199
     1200
     1201
    11771202            }
    11781203        }
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/reference/template-source.php

    r9822 r11311  
    3131                </span>
    3232                <span><a href="<?php echo get_source_file_link(); ?>"><?php _e( 'View on Trac', 'wporg' ); ?></a></span>
     33
    3334            </p>
    3435        <?php else : ?>
Note: See TracChangeset for help on using the changeset viewer.