Making WordPress.org


Ignore:
Timestamp:
03/25/2019 10:24:51 PM (7 years ago)
Author:
coffee2code
Message:

Developer: Move auto-link exception handling into link_internal_element() so as to apply in a broader range of contexts.

Previous implementation only affected auto-linking in deprecation notice, but the need for the exception could also apply in text, param descriptions, see alsos, etc.

Props rahmohn, coffee2code.
See #4310.

File:
1 edited

Legend:

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

    r8466 r8525  
    170170                $url = '';
    171171
     172                // Exceptions for externally-linked elements.
     173                $exceptions = [
     174                        'error_log()' => 'https://secure.php.net/manual/en/function.error-log.php',
     175                ];
     176
     177                // Link exceptions that should actually point to external resources.
     178                if ( ! empty( $exceptions[ $link ] ) ) {
     179                        $url = $exceptions[ $link ];
     180                }
     181
    172182                // Link to class variable: {@see WP_Rewrite::$index}
    173                 if ( false !== strpos( $link, '::$' ) ) {
     183                elseif ( false !== strpos( $link, '::$' ) ) {
    174184                        // Nothing to link to currently.
    175185                }
Note: See TracChangeset for help on using the changeset viewer.