Making WordPress.org


Ignore:
Timestamp:
06/05/2014 09:42:29 PM (12 years ago)
Author:
coffee2code
Message:

Code Reference: Add inline source code display for functions and methods. props atimmer. See #176

File:
1 edited

Legend:

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

    r657 r676  
    117117        endif; ?>
    118118
     119        <?php if ( 'wp-parser-function' === get_post_type() || 'wp-parser-method' === get_post_type() ) : ?>
     120                <hr />
     121                <section class="source-content">
     122                        <h2><?php _e( 'Source', 'wporg' ); ?></h2>
     123                        <div class="source-code-container">
     124                                <pre class="brush: php; toolbar: false;"><?php echo esc_html( get_source_code() ); ?></pre>
     125                        </div>
     126                        <p><a href="#" class="show-complete-source"><?php _e( 'View full source code&hellip;', 'wporg-developer' ); ?></a></p>
     127                </section>
     128        <?php endif; ?>
     129
    119130<?php endif; ?>
    120131
Note: See TracChangeset for help on using the changeset viewer.