While working on my Read Offline plugin, I wanted to implement permalinks. After intensive googling and reading the WordPress source I thought I’d share my findings.
This commented plugin demonstrates how to implement a custom permalink for your plugin. To test, add the
[mypermalink val="ipsum"] shortcode to a page or post.
You can view the plugin source at soderlind.no
- Download the plugin and extract the my-permalink-demo.zip
- Upload the extracted
my-permalink-demofolder to the
- Activate the plugin through the ‘Plugins’ menu in WordPress
Contributors & Developers
“My Permalink Demo” is open source software. The following people have contributed to this plugin.Contributors
- Tested & found compatible with WP 4.7.
- Tested & found compatible with WP 4.6.
- Update plugin for WordPress Coding Standards.
- Tested & found compatible with WP 4.5.
- General housekeeping.
- Tested with WordPress 4.3
- Tested with WordPress 3.9, bumped version number
- Thanks to Paul, the plugin now only flushes the rewrite rules when needed.
- Fixed a bug in my_permalink_url() that gave 404 for blogs in a subdirectory.
- Initial release