Creating Custom Filters — a practical guide to WordPress apply_filters with clear examples you can reuse in real projects.
WordPress Plugin Development Series (13/95). Prefer one article? Read the complete WordPress plugin development tutorial.
Short description
Always return a value from filter callbacks. Provide sensible defaults.
Custom filter
$label = apply_filters('acme_button_label', 'Save');
add_filter('acme_button_label', function ($label) {
return 'Save changes';
});