Changeset 10607 for trunk/wp-admin/theme-editor.php
- Timestamp:
- 02/20/2009 08:00:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/theme-editor.php
r10194 r10607 88 88 $f = fopen($real_file, 'r'); 89 89 $content = fread($f, filesize($real_file)); 90 $content = htmlspecialchars($content); 90 91 if ( 'php' == mb_substr( $real_file, mb_strrpos( $real_file, '.' ) + 1 ) ) { 92 $functions = wp_doc_link_parse( $content ); 93 94 $docs_select = '<select name="docs-list" id="docs-list">'; 95 $docs_select .= '<option value="">' . __( 'Function Name...' ) . '</option>'; 96 foreach ( $functions as $function) { 97 $docs_select .= '<option value="' . urlencode( $function ) . '">' . htmlspecialchars( $function ) . '()</option>'; 98 } 99 $docs_select .= '</select>'; 100 } 101 102 $content = htmlspecialchars( $content ); 91 103 } 92 104 … … 188 200 <input type="hidden" name="theme" value="<?php echo $theme ?>" /> 189 201 </div> 202 <?php if ( count( $functions ) ) : ?> 203 <div id="documentation"><label for="docs-list">Documentation:</label> <?php echo $docs_select ?> <input type="button" class="button" value=" <?php _e( 'Lookup' ) ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_locale() ) ?>&version=<?php echo urlencode( $wp_version ) ?>&redirect=true'); }" /></div> 204 <?php endif; ?> 190 205 191 206 <div>
Note: See TracChangeset
for help on using the changeset viewer.