Insults has to be one of the most pointless plugins in the WordPress repository. It was the first plugin we ever submitted to WP and was done so - like a few others - just to test the WordPress waters and get a feel for how their approval process worked. The plugin will retrieve an 'insult' from a database of thousands and return it. Simple. Like all plugins, it'll find its place somewhere.
This post will show you how to access a random insult via our API with shortcode, PHP, or with our WordPress plugin.
The result of this function will render something like this on your website:
"Any friend of yours -- is a friend of yours."
Cheesy, we know.
Copy and paste the WordPress function into your theme's
functions.php file or, if you sensibly have one installed, your custom functions plugin. You may optionally download and install our plugin from the bottom of of the page.
Insert the shortcode of
[insult] wherever it is you want your insult to be rendered. The default code will cache the text for 1 hours (3600 seconds) but you can get them as often as every 6 minutes. We cache the text locally on our end for 5 minutes.
Used outside of WordPress, the following PHP function may be used. It requires the use of Simple Cache.
The plugin version is hosted in the WordPress plugin repository.