Signature
apply_filters( 'mam_nws_weather_phone_data', array $data_array );
| Parameter |
Type |
Description |
$data_array |
array |
The full app data payload. $data_array['weather'] is the array of forecast cards just built (one per location: title, period, temperature, wind, forecast, imageurl, lat, lon, layout fields). |
When it runs
At the end of the plugin’s mam_get_phone_data_before_send handler (priority 999), only on payloads that include weather — i.e. when a Weather section is in the role’s home screen stack or the site uses the developer location filters.
Example — cap the strip at five nearest locations
add_filter( 'mam_nws_weather_phone_data', function ( $data_array ) {
if ( ! empty( $data_array['weather'] ) ) {
$data_array['weather'] = array_slice( $data_array['weather'], 0, 5 );
}
return $data_array;
} );
Notes
- Cards are already distance-sorted (nearest first) when the app shared its location.
- Removing the
weather key entirely makes the app hide the element.
Related articles
| Field |
Value |
| Article type |
Hook Reference |
| Plugin slug |
mam-nws-weather |
| Applies to plugin version |
2.0+ |
| Category |
Extending MAM Suite |
| Hook type |
filter |
| Audience |
PHP developer |
| Last verified |
2026-06-12 |