TuneSera provides WordPress filters so developers can change its behaviour without editing plugin files. Add these to a small custom plugin or your child theme’s functions.php.
Free plugin filters#
| Filter | Arguments | Use it to |
|---|---|---|
tunesera_directory_station_query_args | $query_args, $sort | Change the WP_Query arguments used by the directory. |
tunesera_directory_sort_options | $sorts | Sort options offered to visitors. Default: newest, name_asc, name_desc. |
tunesera_directory_initial_options | $options | The directory’s initial filter and view options. |
tunesera_home_station_query_args | $args, $mode, $country | Query arguments for homepage, featured and popular station sections. |
tunesera_home_default_country | $country | Default country for country-based homepage sections. |
tunesera_import_batch_size | $size, $options | Stations processed per import batch (default 100). |
tunesera_import_permissions | $allowed, $options | Whether the current user may run imports. |
tunesera_import_directory_countries | $countries | Countries offered in the bundled directory import. |
tunesera_metadata_request_limit | $limit | Maximum outgoing now-playing requests per minute, site-wide (default 60, maximum 120). |
tunesera_admin_settings | $settings | Data passed to the admin settings app. |
tunesera_overview_data | $data | Data shown on the TuneSera dashboard. |
tunesera_admin_promotion_enabled | $enabled | Return false to hide Pro promotions in the free plugin. |
tunesera_pro_upgrade_url | $url | The upgrade link used in the free plugin. |
TuneSera Pro filters#
| Filter | Arguments | Use it to |
|---|---|---|
tunesera_pro_country_lookup_url | $url | Country lookup service for local discovery (default https://api.country.is/). |
tunesera_pro_analytics_country | $country, $request | Provide a verified two-letter listener country for analytics, for example from a local GeoIP database. |
tunesera_pro_analytics_rate_limit | $limit | Maximum analytics events accepted per rate window (default 600). |
tunesera_analytics_health_thresholds | $thresholds | When a station is flagged in Playback Health. Default: 20 attempts minimum, 90% success. |
Examples#
Only list stations that broadcast on FM:
add_filter( 'tunesera_directory_station_query_args', function ( $args, $sort ) {
$args['meta_query'][] = array(
'key' => '_tunesera_broadcast_type',
'value' => 'FM',
'compare' => 'LIKE',
);
return $args;
}, 10, 2 );Use a local GeoIP lookup for analytics countries (Pro):
add_filter( 'tunesera_pro_analytics_country', function ( $country, $request ) {
// Return a verified two-letter ISO code from your server's GeoIP provider.
return $country;
}, 10, 2 );Filters can change in future releases. Test after updating, and keep customisations in a child theme or custom plugin so updates don’t overwrite them.
Related articles#
Was this article helpful?