Create a filter for adding sites via themes and other plugins
-
Great plugin, being able to call it from themes or other plugins would be really useful.
You can add a filter just before you print the HTML, in dns-prefetch.php line 126.
Before:
$tta = explode("\n", $options[DPF_DEFAULT_TEXT_NAME]);
After:
$tta = explode("\n", $options[DPF_DEFAULT_TEXT_NAME]); $tta = apply_filters('dpf_domains', $tta);
Now we can add our own prefetch domains via:
add_filter('dpf_domains', function($tta) { $tta[] = '//another-domain.com'; return $tta; });
Cheers!
- The topic ‘Create a filter for adding sites via themes and other plugins’ is closed to new replies.