The link_title WordPress PHP Filter allows you to modify the OPML outline link title text.
Usage
add_filter('link_title', 'your_custom_function');
function your_custom_function($title) {
// your custom code here
return $title;
}
Parameters
$title(string) – The OPML outline title text.
More information
See WordPress Developer Resources: link_title
Examples
Uppercase Link Title
Make the link title text uppercase.
add_filter('link_title', 'uppercase_link_title');
function uppercase_link_title($title) {
return strtoupper($title);
}
Add Prefix to Link Title
Add a prefix to the link title text.
add_filter('link_title', 'add_prefix_to_link_title');
function add_prefix_to_link_title($title) {
return 'Prefix - ' . $title;
}
Add Suffix to Link Title
Add a suffix to the link title text.
add_filter('link_title', 'add_suffix_to_link_title');
function add_suffix_to_link_title($title) {
return $title . ' - Suffix';
}
Replace Text in Link Title
Replace specific text in the link title.
add_filter('link_title', 'replace_text_in_link_title');
function replace_text_in_link_title($title) {
return str_replace('Old Text', 'New Text', $title);
}
Remove Numbers from Link Title
Remove all numbers from the link title text.
add_filter('link_title', 'remove_numbers_from_link_title');
function remove_numbers_from_link_title($title) {
return preg_replace('/[0-9]/', '', $title);
}