WordPress.org

Make WordPress Core

Ticket #33120: 33120.2.diff

File 33120.2.diff, 1.1 KB (added by extendwings, 5 years ago)

Add Documentation

  • wp-includes/script-loader.php

    diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php
    index 5a6230b..dcebc13 100644
    a b function wp_default_scripts( &$scripts ) { 
    401401
    402402        $scripts->add( 'word-count', "/wp-admin/js/word-count$suffix.js", array(), false, 1 );
    403403        did_action( 'init' ) && $scripts->localize( 'word-count', 'wordCountL10n', array(
     404                /**
     405                 * Filter the word count type.
     406                 *
     407                 * @since 4.3.0
     408                 *
     409                 * @param string $type The type of word count. Default 'words'.
     410                 *                     Accepts 'characters', 'all' and 'words'.
     411                 */
    404412                /* translators: If your word count is based on single characters (East Asian characters),
    405413                   enter 'characters', or 'all' to include spaces. Otherwise, enter 'words'.
    406414                   Do not translate into your own language. */
    407                 'type' => _x( 'words', 'word count: words, characters or all?' ),
     415                'type' => apply_filters( 'word_count_type', _x( 'words', 'word count: words, characters or all?' ) ),
    408416                'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array()
    409417        ) );
    410418