Make WordPress Core

Ticket #44662: 44662-5.diff

File 44662-5.diff, 2.2 KB (added by birgire, 6 years ago)
  • src/js/_enqueues/lib/link.js

    diff --git src/js/_enqueues/lib/link.js src/js/_enqueues/lib/link.js
    index 7c8c498..10eb3e0 100644
     
    507507
    508508                searchInternalLinks: function() {
    509509                        var waiting,
    510                                 search = inputs.search.val() || '';
     510                                search = inputs.search.val() || '',
     511                                searchLength = parseInt( wpLinkL10n.minimumSearchWordLength, 10 );
    511512
    512                         if ( search.length > 2 ) {
     513                        if ( search.length >= searchLength ) {
    513514                                rivers.recent.hide();
    514515                                rivers.search.show();
    515516
  • src/wp-includes/script-loader.php

    diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
    index fa8b60b..331e71c 100644
    function wp_default_scripts( &$scripts ) { 
    13871387        $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 );
    13881388
    13891389        $scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wp-a11y' ), false, 1 );
     1390
     1391        /* translators: Input word length for incremental post search. Start searching from the number. */
     1392        $minimum_search_word_length = _x( '3', 'minimum length for searching links' );
     1393        if ( ! empty( $minimum_search_word_length ) && is_numeric( $minimum_search_word_length ) ) {
     1394                $minimum_search_word_length = absint( $minimum_search_word_length );
     1395        } else {
     1396                $minimum_search_word_length = 3;
     1397        }
     1398
    13901399        did_action( 'init' ) && $scripts->localize(
    13911400                'wplink',
    13921401                'wpLinkL10n',
    13931402                array(
    1394                         'title'          => __( 'Insert/edit link' ),
    1395                         'update'         => __( 'Update' ),
    1396                         'save'           => __( 'Add Link' ),
    1397                         'noTitle'        => __( '(no title)' ),
    1398                         'noMatchesFound' => __( 'No results found.' ),
    1399                         'linkSelected'   => __( 'Link selected.' ),
    1400                         'linkInserted'   => __( 'Link inserted.' ),
     1403                        'title'                   => __( 'Insert/edit link' ),
     1404                        'update'                  => __( 'Update' ),
     1405                        'save'                    => __( 'Add Link' ),
     1406                        'noTitle'                 => __( '(no title)' ),
     1407                        'noMatchesFound'          => __( 'No results found.' ),
     1408                        'linkSelected'            => __( 'Link selected.' ),
     1409                        'linkInserted'            => __( 'Link inserted.' ),
     1410                        'minimumSearchWordLength' => $minimum_search_word_length,
    14011411                )
    14021412        );
    14031413