Skip to content
Ben Marshall edited this page Feb 26, 2021 · 8 revisions

Filter Reference

apply_filters( 'zerospam_detection_title', string $title, string $setting_msg_key = false )

Applied to the detection meta title.

Parameters

  • $title (string) The detection meta title.
  • $setting_msg_key (string) Setting message key.

Example

add_filter(
  'zerospam_detection_title',
  function( $title, $setting_msg_key ) {
    // Alter the title here.
    return $title;
  }
);

apply_filters( 'zerospam_detection_message', string $message, string $setting_msg_key = false )

Applied to the detection message.

Parameters

  • $message (string) The detection message.
  • $setting_msg_key (string) Setting message key.

Example

add_filter(
  'zerospam_detection_message',
  function( $message, $setting_msg_key ) {
    // Alter the message here.
    return $message;
  }
);

apply_filters( 'zerospam_get_ip', string $ip )

Applied to the IP address used by WordPress Zero Spam.

Parameters

$ip (string) The user's IP address.

Example

add_filter(
  'zerospam_get_ip',
  function( $ip ) {
    // Alter the IP address here.
    return $ip;
  }
);

apply_filters( 'zerospam_settings', array $settings )

Applied to all available WordPress Zero Spam settings.

Parameters

$settings (array) Available WordPress Zero Spam settings.

Example

add_filter(
  'zerospam_settings',
  function( $settings ) {
    // Alter the settings array here.
    return $settings;
  }
);

apply_filters( 'zerospam_types', array $types )

Applied to the WordPress Zero Spam log types.

Parameters

$types (array) Available log types.

Example

add_filter(
  'zerospam_types',
  function( $types ) {
    // Add a custom log type.
    $types['custom_type_key'] = 'Custom Type Name';

    return $types;
  }
);

apply_filters( 'zerospam_setting_sections', array $sections )

Applied to the WordPress Zero Spam available option sections.

Parameters

$sections (string) Array of available sections.

Example

add_filter(
  'zerospam_setting_sections',
  function( $sections ) {
    // Alter the sections here.
    return $sections;
  }
);

apply_filters( 'zerospam_countries', array $countries )

Applied to the list of countries.

Parameters

$countries (array) Available countries.

Example

add_filter(
  'zerospam_countries',
  function( $countries ) {
    // Alter the countries array here.
    return $countries;
  }
);

Action Reference

do_action( 'zerospam_loaded' )

Fires when WordPress Zero Spam was fully loaded and instantiated.

do_action( 'zerospam_init' )

Fires on WordPress Zero Spam init, after WordPress Zero Spam has finished loading but before any headers are sent.