Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

Changeset [64402]: Rewrite Rules: Add support for random content redirects. Introduce a ...

Дата публикации: 16-10-2026 17:03:59


Rewrite Rules: Add support for random content redirects.
Introduce a random query var and /random/ rewrite rules[1], built on the existing rewrite, WP, and query APIs, that redirect to a randomly selected published post. Random requests[2] work for the whole site, taxonomy terms, authors and post type archives, with the base configurable on the Permalinks screen. A new randomable post type argument controls which content is eligible, and the selection runs through the main query so it remains filterable and costs a single database query.
The Random Base[3] is translatable and stored in the rewrite rules. This means that rewrite rules are regenerated when translations are updated or the Site Language is changed. Also, if a post or page is published that would result in the same slug as the Random Base, that content gets priority and nothing will be random[4].
This reintroduces the feature committed in r63767 and reverted in r63906.
1) Literally /random/, not just rules that are random. Though that could be fun too!
2) Not "random" as in unpredictable, but random as in someone wanted it to be random.
3) It's intentionally "random" but it could also intentionally be "aleatoria" or "karkovice".
4) The other random permalinks will still work, so not nothing. But is anything really random?
Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14018
Follow-up to r63767, r63906.
Props jorbin, peterwilsoncc, westonruter, mukesh27, annezazu, mlaetitia, mcsf, johnbillion, TobiasBg, solankisoftware, sajib1223, ellatrix, matt.
See #64498.

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1Changeset [64405]: Fix DB Version. Follow-up to r64402. Unprops Jorbin. See #64498. 09.4416-10-2026
2Changeset [64413]: Widgets: Use booleans in Categories widget arguments. The Categories ...07.4416-10-2026
3Ticket #62762 (WP_Widget_Categories::widget(): use int or bool for $cat_args values ...) closed06.9116-10-2026
4Ticket #66328 (Recovery mode does not recognize network-activated plugins) created05.9216-10-2026
5Changeset [64409]: Build/Test Tools: Cover privacy page creation and policy copying. Add ...08.7516-10-2026
6Changeset [64407]: Build/Test Tools: Verify published post content on the front end. ...010.2516-10-2026
7Changeset [64425]: Tests: Cover updated and removed oEmbed providers. Verify that ...010.2816-10-2026
8Changeset [64419]: Tests: Correct missing-URL coverage for the RSS widget. Fix the ...013.516-10-2026
9Changeset [64424]: Tests: Add coverage for `get_the_category_list()`. Cover unordered ...014.0416-10-2026
10Ticket #66327 (REST API: Add action-set-homepage and action-set-posts-page links to pages) created09.8316-10-2026

Классификация: . Схожих патентов: 0. Схожих новостей: 10. Тональность: 0. Информативность: 5.75. Источник: core.trac.wordpress.org.