WP Hashids
A Hashids implementation for WordPress
by Ryan McLaughlin · github.com/ssnepenthe/wp-hashids · website
★ 3stars
25composer installs
1forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/ssnepenthe/wp-hashids/archive/refs/heads/master.zipAlso on Packagist as ssnepenthe/wp-hashids:
composer require ssnepenthe/wp-hashidsFrom the readme
wp-hashids
This plugin provides a Hashids implementation for WordPress.
Requirements
WordPress 4.7 or greater, PHP 5.6 or greater and Composer.
Installation
Install using Composer:
Usage
Once the plugin is activated, browse to wp-admin settings permalinks and set a custom structure which contains the tag %hashid%.
If you need to manually interact with the underlying Hashids instance for some reason, it can be accessed by calling wphinstance( 'hashids' ).
Configuration
Sensible defaults are automatically set for you.
If you wish to set custom values, there are two methods for doing so:
1) Define any number of WPHASHIDS constants (preferred)
2) Browse to wp-admin settings wp hashids and set the values via the provided interface.
The following constants can be used for configuration:
WPHASHIDSALPHABET - valid options are lower, upper, lowerupper, lowernumber, uppernumber, and all. You will need to manually flush rewrite rules after changing this constant by going to settings permalinks.
WPHASHIDSMINLENGTH - can be any integer = 0.
WPHASHIDSSALT - should be a unique string to ensure hashids are unique to your site.
Keep in mind that any changes to the plugin settings