# support: hooks and filters

Read from support at v1.1.1.

## Actions

Example (mmwp_support_booted):

```php
add_action( 'mmwp_support_booted', function ( $version, $path ) {
    // Your code.
}, 10, 2 );
```

### mmwp_support_booted

Action, since 1.0.0. Anchor: https://mammothwp.com/docs/support/hooks/#mmwp_support_booted

Fires after the winning copy of the package has booted.

| Name | Type | Description |
| --- | --- | --- |
| $version | string | Booted package version. |
| $path | string | Directory of the booted copy. |

Source: https://github.com/mammothwp/support/blob/v1.1.1/src/Kernel.php#L175

## Filters

Example (mmwp_support_action_link):

```php
add_filter( 'mmwp_support_action_link', function ( $enabled, $slug ) {
    // Change $enabled here.
    return $enabled;
}, 10, 2 );
```

### mmwp_support_action_link

Filter, since 1.0.0. Anchor: https://mammothwp.com/docs/support/hooks/#mmwp_support_action_link

Filters whether a plugin gets the "Support" action link.

| Name | Type | Description |
| --- | --- | --- |
| $enabled | bool | Default true. |
| $slug | string | Plugin slug. |

Source: https://github.com/mammothwp/support/blob/v1.1.1/src/Config.php#L157

### mmwp_support_attach_report

Filter, since 1.0.0. Anchor: https://mammothwp.com/docs/support/hooks/#mmwp_support_attach_report

Filters whether `site-report-<host>-<date>.json` is attached to the email.

| Name | Type | Description |
| --- | --- | --- |
| $attach | bool | Default true. |
| $slug | string | Plugin slug. |

Source: https://github.com/mammothwp/support/blob/v1.1.1/src/Config.php#L118

### mmwp_support_branding

Filter, since 1.0.0. Anchor: https://mammothwp.com/docs/support/hooks/#mmwp_support_branding

Filters the resolved branding values (site-owner white-label; wins over everything).

Keys: name, menu_title, page_title, icon, logo_url (local URL only), subject_prefix, ref_prefix, show_powered_by, show_vendor_names.

| Name | Type | Description |
| --- | --- | --- |
| $values | array<string,mixed> | Resolved branding values. |
| $mode | string | mammoth, neutral, vendor or whitelabel. |

Source: https://github.com/mammothwp/support/blob/v1.1.1/src/Kernel.php#L243

### mmwp_support_capability

Filter, since 1.0.0. Anchor: https://mammothwp.com/docs/support/hooks/#mmwp_support_capability

Filters the capability required for the Support screen and operations.

| Name | Type | Description |
| --- | --- | --- |
| $capability | string | Capability, default `manage_options`. |
| $network | bool | True for the network admin screen. |

Source: https://github.com/mammothwp/support/blob/v1.1.1/src/Config.php#L65

### mmwp_support_email

Filter, since 1.0.0. Anchor: https://mammothwp.com/docs/support/hooks/#mmwp_support_email

Filters the support recipient for a plugin. Wins over the constant, the array and the JSON file.

| Name | Type | Description |
| --- | --- | --- |
| $email | string | Resolved address so far. |
| $slug | string | Plugin slug. |

Source: https://github.com/mammothwp/support/blob/v1.1.1/src/Plugin_Factory.php#L111

### mmwp_support_menu

Filter, since 1.0.0. Anchor: https://mammothwp.com/docs/support/hooks/#mmwp_support_menu

Filters the canonical Support screen location. Wins over the constant and the default.

| Name | Type | Description |
| --- | --- | --- |
| $location | string\|null | Null (no override) or toplevel\|tools\|settings\|hidden\|parent:<menu-slug>. |
| $default | string | The location the package would use without an override. |

Source: https://github.com/mammothwp/support/blob/v1.1.1/src/Kernel.php#L211

### mmwp_support_menu_icon

Filter, since 1.0.1. Anchor: https://mammothwp.com/docs/support/hooks/#mmwp_support_menu_icon

Filters the Mammoth WP menu icon (SVG data URI or dashicon name).

Use a 20x20 viewBox, one path, `fill="black"` so WordPress recolours it to the admin scheme.

| Name | Type | Description |
| --- | --- | --- |
| $icon | string | Data URI or dashicon name. |

Source: https://github.com/mammothwp/support/blob/v1.1.1/src/Kernel.php#L272

### mmwp_support_menu_position

Filter, since 1.0.0. Anchor: https://mammothwp.com/docs/support/hooks/#mmwp_support_menu_position

Filters the position of the top-level menu.

| Name | Type | Description |
| --- | --- | --- |
| $position | int | Default 80. |

Source: https://github.com/mammothwp/support/blob/v1.1.1/src/Config.php#L136

### mmwp_support_rate_limit

Filter, since 1.0.0. Anchor: https://mammothwp.com/docs/support/hooks/#mmwp_support_rate_limit

Filters the send rate limit (per user).

| Name | Type | Description |
| --- | --- | --- |
| $limit | array{max:int,window:int} | Max sends and window in seconds. |
| $user_id | int | User id. |

Source: https://github.com/mammothwp/support/blob/v1.1.1/src/Config.php#L91

### mmwp_support_report_sections

Filter, since 1.0.0. Anchor: https://mammothwp.com/docs/support/hooks/#mmwp_support_report_sections

Filters the report sections. Add a `Section_Interface` object. Contract: no secrets; redaction runs over everything, but do not rely on it.

| Name | Type | Description |
| --- | --- | --- |
| $sections | Section_Interface[] | Sections in output order. |

Source: https://github.com/mammothwp/support/blob/v1.1.1/src/Report/Report_Builder.php#L112

### mmwp_support_subject

Filter, since 1.0.0. Anchor: https://mammothwp.com/docs/support/hooks/#mmwp_support_subject

Filters the email subject.

| Name | Type | Description |
| --- | --- | --- |
| $text | string | Formatted subject. |
| $prefix | string | Subject prefix from branding. |
| $slug | string | Plugin slug. |
| $subject | string | User-entered subject. |
| $ref | string | Reference. |

Source: https://github.com/mammothwp/support/blob/v1.1.1/src/Mail/Ticket_Formatter.php#L74

### mmwp_support_transport

Filter, since 1.0.0. Anchor: https://mammothwp.com/docs/support/hooks/#mmwp_support_transport

Filters the mail transport. Only MailTransport (wp_mail) ships. Any transport that sends data off-site needs the same explicit user action as the built-in one.

| Name | Type | Description |
| --- | --- | --- |
| $transport | Transport_Interface | Transport. |

Source: https://github.com/mammothwp/support/blob/v1.1.1/src/Kernel.php#L359
