| 开发者 | robsejp |
|---|---|
| 更新时间 | 2026年11月26日 07:18 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.2 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
/%e3%81%8a%e7%9f%a5%e3%82%89%e3%81%9b/. It works, but it is unreadable in a
browser bar, it breaks when pasted into chat, and it is useless in a report.
The usual fix is to type an English slug by hand for every single post, and the
usual result is that somebody forgets.
Robse Auto Alpha Slug fills the slug in for you when you save. Kana are romanized, so
おしらせ becomes oshirase and デイサービス becomes deisabisu. A slug you
typed yourself in plain ASCII is always left alone.
Kanji are handled honestly
This is where other plugins quietly go wrong. PHP has no reliable way to read
kanji: the ICU transliterator that most plugins call reads them as Chinese,
so 村松 comes out as cun-song and 出雲そば as chu-yunsoba. That is not a
slug anybody wants, and it is worse than no slug at all because it looks
deliberate.
So this plugin does not guess. When a title contains kanji it cannot resolve,
it uses a predictable pattern instead — post-123 by default — and leaves the
guessing to you:
post-123.出雲 = izumo 美食旅 = gourmet-trip 村松英俊 = muramatsu-hidetoshi
Now 出雲そば 美食旅 becomes izumo-soba-gourmet-trip instead of falling back.
Longer terms win over shorter ones, so 出雲市 can differ from 出雲.
No intl extension required
The kana table is built into the plugin, so romanization works the same on a
server without the intl extension. Sokuon and youon are handled: まっちゃ
becomes matcha, ぎゅうにゅう becomes gyuunyuu.
Everything else
No. A slug written in ASCII letters, digits, hyphens or underscores is treated as deliberate and kept, whatever the title says.
Not on its own. Slugs are only generated when a post is saved. If you open an old post with a percent-encoded slug and save it, the slug is replaced — turn off Replace slugs that arrive percent-encoded in the settings if you would rather that never happened.
Because a wrong reading is worse than no reading. See the description above. Add the words to the dictionary, or switch the mode to Drop the kanji, and you will get a text slug.
Yes. By default every post type with an editing screen is handled. You can
restrict that on the settings page, or with the robse_auto_alpha_slug_post_types
filter.
Yes, filter robse_auto_alpha_slug_generated:
add_filter( 'robse_auto_alpha_slug_generated', function ( $slug, $title, $post_type, $post_id ) { return 'news-' . $slug; }, 10, 4 );
rm_auto_alpha_slug_post_types filter still works.