The dashboard_secondary_title WordPress PHP filter allows you to modify the secondary link title for the ‘WordPress Events and News’ dashboard widget.
Usage
add_filter('dashboard_secondary_title', 'my_custom_dashboard_secondary_title');
function my_custom_dashboard_secondary_title($title) {
// your custom code here
return $title;
}
Parameters
$title(string): Title attribute for the widget’s secondary link.
More information
See WordPress Developer Resources: dashboard_secondary_title
Examples
Change the secondary link title
Change the secondary link title for the ‘WordPress Events and News’ dashboard widget to ‘My Custom Title’.
add_filter('dashboard_secondary_title', 'change_dashboard_secondary_title');
function change_dashboard_secondary_title($title) {
$title = 'My Custom Title';
return $title;
}
Add a prefix to the secondary link title
Add a prefix ‘New: ‘ to the secondary link title for the ‘WordPress Events and News’ dashboard widget.
add_filter('dashboard_secondary_title', 'add_prefix_to_dashboard_secondary_title');
function add_prefix_to_dashboard_secondary_title($title) {
$title = 'New: ' . $title;
return $title;
}
Make the secondary link title uppercase
Convert the secondary link title for the ‘WordPress Events and News’ dashboard widget to uppercase.
add_filter('dashboard_secondary_title', 'make_dashboard_secondary_title_uppercase');
function make_dashboard_secondary_title_uppercase($title) {
$title = strtoupper($title);
return $title;
}
Add the current date to the secondary link title
Append the current date to the secondary link title for the ‘WordPress Events and News’ dashboard widget.
add_filter('dashboard_secondary_title', 'add_date_to_dashboard_secondary_title');
function add_date_to_dashboard_secondary_title($title) {
$date = date('Y-m-d');
$title .= ' - ' . $date;
return $title;
}
Remove vowels from the secondary link title
Remove all vowels from the secondary link title for the ‘WordPress Events and News’ dashboard widget.
add_filter('dashboard_secondary_title', 'remove_vowels_from_dashboard_secondary_title');
function remove_vowels_from_dashboard_secondary_title($title) {
$title = preg_replace('/[aeiou]/i', '', $title);
return $title;
}