Register Plugin¶
-
do_action
(string $action, string $slug, string $name) → void Register plugin.
Parameters: - $action (string) – Must be
wp_fail2ban_register_plugin
. - $slug (string) – Plugin slug. This must be the actual plugin slug. Maximum length is 200.
- $name (string) – Plugin display name. This should be an unescaped string - HTML is allowed.
Throws: - LengthException – Either
$slug
or$name
is too long; themessage
will say which. - RuntimeException – Database error (Premium only).
- $action (string) – Must be
Example¶
try {
do_action('wp_fail2ban_register_plugin', 'my-plugin-slug', 'My Plugin Name');
} catch(\LengthException $e) {
// slug or name too long
} catch(\RuntimeException $e) {
// database error
}