You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Document the slug-change protection (block editor + Quick Edit)
- Add WPML to the integrations list
- Add a manual zip-install path alongside Composer
- Add an "Upgrading from 0.x" section explaining the use_slug
opt-in flip and the auto-migration that preserves existing URLs
- Bump the WordPress requirement to 6.0+
Copy file name to clipboardExpand all lines: README.md
+31-2Lines changed: 31 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,15 @@ An optional checkbox lets you use the assigned page's slug as the post type's re
42
42
43
43
> **Warning**: Enabling this option changes all single post URLs for the post type. Consider the SEO implications before toggling it on an existing site.
44
44
45
+
### Slug-change protection
46
+
47
+
Once "Use page slug as rewrite slug" is on, changing the page slug breaks every published URL for that custom post type. The plugin guards both editing surfaces:
48
+
49
+
-**Block editor**: a warning notice and confirmation checkbox appear in the document sidebar; the Update button stays disabled until the checkbox is ticked.
50
+
-**Quick Edit** on the Pages list: a confirmation dialog blocks the save until acknowledged.
51
+
52
+
Both only fire when the slug actually differs from the saved value, on pages assigned to a CPT with "use page slug" enabled.
53
+
45
54
## Key differences with native CPT archives
46
55
47
56
|| CPT archive | Page for CPT |
@@ -119,6 +128,16 @@ Requires Polylang 3.4+.
119
128
120
129
Requires Yoast SEO 26+.
121
130
131
+
### WPML
132
+
133
+
Multilingual support via WPML's String Translation:
134
+
135
+
- Each language can have its own assigned page
136
+
- Archive URLs follow WPML's URL structure
137
+
- Page slugs are translatable when using the "use page slug" option
138
+
139
+
Requires WPML 4.5+.
140
+
122
141
### The SEO Framework
123
142
124
143
- SEO metadata support
@@ -136,17 +155,27 @@ Requires ACF 6+.
136
155
137
156
## Requirements
138
157
158
+
- WordPress 6.0+
139
159
- PHP 8.2+
140
-
- WordPress with publicly queryable custom post types
141
160
142
161
## Installation
143
162
144
-
Install via Composer:
163
+
### Composer (recommended)
145
164
146
165
```bash
147
166
composer require n5s/page-for-custom-post-type
148
167
```
149
168
169
+
### Manual
170
+
171
+
Download the latest `page-for-custom-post-type-X.Y.Z.zip` from the [releases page](https://github.com/nlemoine/page-for-custom-post-type/releases) and upload it via **Plugins > Add New > Upload Plugin**. The zip ships with vendor dependencies bundled, so no build step is required.
172
+
173
+
## Upgrading from 0.x
174
+
175
+
1.0 makes the "use page slug" behavior opt-in (it was previously always on). On upgrade, the plugin automatically enables it for every CPT that already has a page assigned, so existing URLs stay intact. If you'd rather use the default CPT rewrite slugs going forward, uncheck the option per CPT under **Settings > Reading**.
176
+
177
+
The legacy procedural API (`is_page_for_custom_post_type()`, `get_page_id_for_custom_post_type()`, etc.) is preserved as deprecated shims that forward to the namespaced equivalents. They'll emit a `_doing_it_wrong` notice when `WP_DEBUG` is on.
0 commit comments