Download the PHP package davidwebca/wp-polylang-translate-rewrite-slugs without Composer
On this page you can find all versions of the php package davidwebca/wp-polylang-translate-rewrite-slugs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download davidwebca/wp-polylang-translate-rewrite-slugs
More information about davidwebca/wp-polylang-translate-rewrite-slugs
Files in davidwebca/wp-polylang-translate-rewrite-slugs
Package wp-polylang-translate-rewrite-slugs
Short Description Polylang - Translate URL Rewrite Slugs
License
Homepage https://github.com/davidwebca/wp-polylang-translate-rewrite-slugs
Informations about the package wp-polylang-translate-rewrite-slugs
Polylang - Translate URL Rewrite Slugs
WordPress plugin that add rewrite url slugs translation feature to Polylang.
Work in progress ;)
Upgrade notice < 0.3.0
If you used a version prior to 0.3.0, the plugin will probably crash as the structure of the param for the "pll_translated_post_type_rewrite_slugs" filter has changed.
Translate Post Type URLs
Translate rewrite slugs for post types by doing 5 things:
- Remove original extra rewrite rules and permastruct for these post types;
- Translate the extra rewrite rules and permastruct for these post types;
- Stop Polylang from translating rewrite rules for these post types;
- Fix "get_permalink" for these post types.
- Fix "get_post_type_archive_link" for these post types.
To translate a post type rewrite slug, add the filter "pll_translated_post_type_rewrite_slugs" to your functions.php file or your plugin and add the "has_archive" and "rewrite" key has you normally do for the params of the "register_post_type" Wordpress function but add it for each post type and language you want.
Example