benecaster_reserved_permalink_prefixes
Adds URL prefixes a podcaster may not use as a show or episode prefix under Settings → Permalinks. Use it when your plugin serves pages under a top-level segment, so a podcaster can’t choose that segment as a prefix and turn every one of your URLs into an episode lookup. A podcaster who tries gets the usual reserved word error naming the word.
This filter can add a prefix and never remove one. Benecaster’s own list is merged back in after the filter runs, so returning an empty array reserves exactly as much as returning the list unchanged. Core reserves words like wp-admin and feed because a prefix matching them breaks the site; if you want one of those, rename your route.
Values are lowercased and trimmed for you, and anything that isn’t a string is dropped. go is already reserved, for the Outlinks add-on’s /go/… links, whether or not Outlinks is installed.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$prefixes |
array |
— | The reserved prefixes, lowercase. Return it with your own appended. |
Returns:
array
Example
add_filter( 'benecaster_reserved_permalink_prefixes', function ( array $prefixes ): array {
$prefixes[] = 'shop'; // my-addon serves /shop/{slug}
return $prefixes;
} );
Need this built rather than just documented? See our services →