WordPress.org

Make WordPress Core

Ticket #14808: filter.diff

File filter.diff, 2.8 KB (added by exthilion, 5 years ago)

Apply @GaryJ's original patch to theme and plugin editor

  • wp-admin/plugin-editor.php

    diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php
    index 1558164..fa706dd 100644
    a b foreach ( $plugin_files as $plugin_file ) : 
    260260                <input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" />
    261261                </div>
    262262                <?php if ( !empty( $docs_select ) ) : ?>
    263                 <div id="documentation" class="hide-if-no-js"><label for="docs-list"><?php _e('Documentation:') ?></label> <?php echo $docs_select ?> <input type="button" class="button" value="<?php esc_attr_e( 'Look Up' ) ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_locale() ) ?>&amp;version=<?php echo urlencode( $wp_version ) ?>&amp;redirect=true'); }" /></div>
     263                <div id="documentation" class="hide-if-no-js"><label for="docs-list"><?php _e('Documentation:') ?></label> <?php echo $docs_select ?> <input type="button" class="button" value="<?php esc_attr_e( 'Look Up' ) ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( '<?php echo esc_url( apply_filters( 'file_editor_documentation_url', 'http://api.wordpress.org/core/handbook/1.0/?function=', urlencode( $plugin ), $file ) ); ?>' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_locale() ) ?>&amp;version=<?php echo urlencode( $wp_version ) ?>&amp;redirect=true'); }" /></div>
    264264                <?php endif; ?>
    265265<?php if ( is_writeable($real_file) ) : ?>
    266266        <?php if ( in_array( $file, (array) get_option( 'active_plugins', array() ) ) ) { ?>
  • wp-admin/theme-editor.php

    diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php
    index 6fae2b7..ceb8262 100644
    a b else : ?> 
    263263                <div id="documentation" class="hide-if-no-js">
    264264                <label for="docs-list"><?php _e('Documentation:') ?></label>
    265265                <?php echo $docs_select; ?>
    266                 <input type="button" class="button" value=" <?php esc_attr_e( 'Look Up' ); ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_locale() ) ?>&amp;version=<?php echo urlencode( $wp_version ) ?>&amp;redirect=true'); }" />
     266                <input type="button" class="button" value=" <?php esc_attr_e( 'Look Up' ); ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( '<?php echo esc_url( apply_filters( 'file_editor_documentation_url', 'http://api.wordpress.org/core/handbook/1.0/?function=', urlencode( $stylesheet ), $file ) ); ?>' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_locale() ) ?>&amp;version=<?php echo urlencode( $wp_version ) ?>&amp;redirect=true'); }" />
    267267                </div>
    268268        <?php endif; ?>
    269269