When you create a plugin for UserSpice, you can use our plugin hooks to allow you to inject code on common pages without modifying the page itself. Basically when you do your install.php file for your plugin, put
$hooks['account.php']['bottom'] = 'hooks/accountbottom.php';
So list the page, the position and the link to the file that is the “include” on that page. Note that you can use the same include on multiple pages. There’s nothing wrong with also doing…
$hooks['join.php']['bottom'] = 'hooks/accountbottom.php';
if your include code is the same. Be sure to test your hooks because you can seriously break projects. Plugin hooks are automatically uninstalled when a plugin is uninstalled.
If you want to know exactly where a plugin hook will be in the code, visit the page referenced and look for the includeHook function like
The new ‘pre’ hook is usually included right below the getMyHooks() function.
|account.php||✅||❌||✅||❌||✅||Body is below gravitar. Bottom is bottom right.|
|admin.php?view=general||✅||❌||✅||❌||❌||Do form and post in one div or use the built in settings table AJAX|
|admin.php?view=social(v4.4)||❌||❌||✅||❌||❌||Do form and post in one div or use the built in settings table AJAX|
|admin.php?view=user (v5.0.5+)||✅||✅||✅||✅||✅||Body is above the form.|
|admin.php?view=users (v5.0.5+)||✅||✅||✅||✅||✅||Pre is above the table. Body is the table header. Bottom is the table. Form is the new user modal.|
|join.php||✅||✅||✅||✅||✅||Form is inside /views/_join.php|
|login.php||✅||✅||✅||✅||✅||Post is just before validation passed so you can boot them.|