Skip to content

Commit a60faa3

Browse files
committed
Adding information to readme.txt
1 parent 2ff073e commit a60faa3

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

readme.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,33 @@ This WordPress plugin randomizes the user_id for the user created on WordPress s
1313
Since WordPress version 4.9, it also randomizes the ID for all other users created after its setup.
1414
In WordPress versions prior to 4.9, this feature requires installing the patch from WP Issue https://core.trac.wordpress.org/ticket/40545
1515

16+
== How it works ==
17+
18+
Once activated, the plugin will immediately replace the ID for the default admin user (with user ID 1). By default, the plugin will use
19+
random user IDs between 1 and 4503599627370495 (to ensure compatibility with Javascript code using the user ID).
20+
21+
All newly created users from that moment will be generated with a random user ID in the defined range.
22+
23+
== How to customize the range for new user IDs ==
24+
25+
You can customize the range used by the plugin for the random generated user IDs by using the WordPress filters dfx_random_user_id_max_id and dfx_random_user_id_min_id.
26+
27+
For example, if you want to have all your user IDs between 1000 and 9999 you can add the following lines to your theme’s functions.php file:
28+
29+
```
30+
function set_dfx_max_user_id( $default_max_id ) {
31+
return 9999;
32+
}
33+
add_filter( 'dfx_random_user_id_max_id', 'set_dfx_max_user_id' );
34+
35+
function set_dfx_min_user_id( $default_max_id ) {
36+
return 1000;
37+
}
38+
add_filter( 'dfx_random_user_id_min_id', 'set_dfx_min_user_id' );
39+
```
40+
41+
Probably, you’ll want to add these lines to your code before activating the plugin, so your new random main admin user ID is inside your desired range.
42+
1643
== Changelog ==
1744

1845
= 20201115 =

0 commit comments

Comments
 (0)