Making WordPress.org


Ignore:
Timestamp:
06/05/2014 09:46:52 PM (10 years ago)
Author:
coffee2code
Message:

Code Reference: Improvements to inline source code display. Fixes #176

  • More efficient implementation of get_source_code()
  • Add get_source_code_root_dir() which gets 'wp_parser_root_import_dir' option value if set by parser, else ABSPATH
  • Add post_type_has_source_code()
  • Use 'wporg' as the text domain
  • Slight tweak to JS height comparison to ensure functions that just fit don't trigger expansion handling
  • Allow x scrollbar for .source-code-container and adjust heights to account for its possible display
  • Add extra height to collapsed state of .source-code-container to partially show the first hidden line to better indicate there is more code
  • Add right border to .source-code-container so it is easier to tell if code is being clipped
  • Change 'View source' link to 'View source code:' label with explicit links to inline source and/or WP Trac code browser
  • Source code is stored in post meta; parse and store it as requested if it isn't
  • Sanity check to ensure proper conditions exist for parsing
  • Add optional 'force_parse' arg to get_source_code() to force reparsing of source file
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-wp-parser-hook.php

    r657 r677  
    2727        ?>
    2828        <section class="source">
    29             <p><strong><?php _e( 'Source file:', 'wporg' ); ?> </strong><a href="<?php echo get_source_file_archive_link( $source_file ); ?>"><?php echo esc_html( $source_file ); ?></a></p>
    30             <p><a href="<?php echo get_source_file_link(); ?>"><?php _e( 'View source&hellip;', 'wporg' ); ?></a></p>
     29            <p>
     30                <strong><?php _e( 'Source file:', 'wporg' ); ?></strong>
     31                <a href="<?php echo get_source_file_archive_link( $source_file ); ?>"><?php echo esc_html( $source_file ); ?></a><br />
     32                <strong><?php _e( 'View source code:', 'wporg' ); ?></strong>
     33                <a href="<?php echo get_source_file_link(); ?>"><?php _e( 'on the WP Trac code browser&hellip;', 'wporg' ); ?></a>
     34            </p>
    3135        </section>
    3236    <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.