Commit 2274b54
refactor(polylang): remove redundant resolvers, add archive link resolver, harden for non-polylang
- Remove ResolveHomeUrl (dead code; home_url already handled by Polylang core)
- Remove ResolvePageTreeMenuPageIds (option_page_on_front/page_for_posts
handled natively by Polylang; cache key duplicated ResolveNavigationCacheKey)
- Remove ResolveCurrentPostId (primary branch was a no-op — option_page_for_<pt>
is already translated by ResolveTranslatedPostTypeLink before the helper reads it)
- Unregister removed resolvers from App.php
- Add ResolveTranslatedPostTypeArchiveLink to translate post_type_archive_link
when the wp-page-for-posttype plugin bakes the default-language slug into
the registered post type rewrite (with full unit tests)
- Early-return in ResolveTranslatedPostTypeLink::registerPostTypeHooks when
Polylang is not active to avoid iterating all public post types on
non-Polylang sites
- Skip registering the pre_get_posts action in ResolveFontAttachmentQueries
when Polylang is not active so non-Polylang sites pay no per-query cost
Agent-Logs-Url: https://github.com/helsingborg-stad/Municipio/sessions/16905c3e-4839-4e00-bf43-e1cf0cd39e72
Co-authored-by: sebastianthulin <797129+sebastianthulin@users.noreply.github.com>1 parent 9e90431 commit 2274b54
13 files changed
Lines changed: 367 additions & 639 deletions
File tree
- library
- Integrations/Polylang
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
513 | | - | |
514 | | - | |
515 | 513 | | |
516 | 514 | | |
517 | 515 | | |
518 | 516 | | |
| 517 | + | |
519 | 518 | | |
520 | 519 | | |
521 | 520 | | |
| |||
This file was deleted.
Lines changed: 0 additions & 103 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| |||
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
36 | 56 | | |
37 | 57 | | |
38 | 58 | | |
| |||
0 commit comments