| 开发者 | fyrins |
|---|---|
| 更新时间 | 2026年11月13日 16:22 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
We help every <baker, potter, beekeeper> find their customers.
There is no settings page, no option in your database, no account and no outgoing request.
How it behaves
defer in the footer, and a stylesheet under 1 KB.<span> with a class and a data attribute. If you deactivate the plugin, the selected word simply stays in the sentence, and no block is invalidated.retype_delays filter. See the FAQ.
Source code and build
The scripts and stylesheets shipped in build/ are compiled from the src/ directory of the public repository, with @wordpress/scripts, the build tool maintained by the WordPress project:
https://github.com/Fyrins/retype
To reproduce the shipped files:
git clone https://github.com/Fyrins/retype.git cd retype npm install npm run build
Click inside the word and choose Retype again. The popover opens with the current list. Remove format turns the word back into ordinary text. An empty list does the same.
The one you selected in the editor. It is also the word screen readers read and the word shown to visitors who prefer reduced motion, so pick the one that makes the sentence work on its own.
For one word, in the popover: "Typing delay per letter" is in milliseconds, lower is faster, and erasing speeds up or slows down in proportion. "Pause on each word" is in seconds. Reset brings a setting back to the site default.
For the whole site, use the retype_delays filter, in your theme's functions.php or a small plugin of your own. Values are in milliseconds:
add_filter( 'retype_delays', function ( $delays ) { $delays['type'] = 90; // per letter while typing, default 40 $delays['erase'] = 30; // per letter while erasing, default 20 $delays['hold'] = 2500; // pause on each word, default 1200 return $delays; } );
Missing keys keep their default. type and erase are kept between 10 and 2000, hold between 200 and 60000, and anything that is not a number falls back to the default.
A script of your own can also set window.retypeDelays before the plugin's script runs, with the same keys and the same limits. The settings of a word in the popover take precedence over both.
Yes. The popover offers the colors of your theme's palette. A palette color is saved as a reference to the theme color, so the caret follows it if the theme changes it. Clear the color and the caret takes the color of the text.
In the post content, as data attributes of the word's <span>: data-retype-type and data-retype-hold in milliseconds, data-retype-caret for the color. Nothing goes to the database besides your post. Values out of range are confined to the same limits as the filter, and a color that is not a hex, rgb(), hsl() or theme palette color is ignored.
Yes, if the whole word is: the formatting stays and only the letters change. If only part of the word is formatted, the word is shown as it is, without animation, because it could not be retyped letter by letter without rebuilding your markup.
The format is registered for every rich text field of the block editor, so the site editor offers it too, in headings and paragraphs of templates and patterns. On the front end, any rendered block that contains it loads the script.
The animated word does not wrap, so a word wider than the screen is clipped. Keep the words short, especially in large headings.
No. There is no telemetry, no external asset, no outgoing request, and nothing is written to your database.
retype_delays filter for the default typing, erasing and pause delays.