Created
December 8, 2017 04:03
-
-
Save nandaleite/6fbce8a549b7f93e4c76180ff581c21b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // You can filter the title of most widgets and change the markup. The name of the filter is 'widget_title' and the third parameter tells you the type of the filtered widget. | |
| add_filter( 'widget_title', 'wpse_52108_nav_widget_title_link', 30, 3 ); | |
| /** | |
| * Changes the title for the nav menu widget. | |
| * | |
| * @param string $title | |
| * @param string $instance | |
| * @param string $id_base | |
| * @return string | |
| */ | |
| function wpse_52108_nav_widget_title_link( $title, $instance = NULL, $id_base = '' ) | |
| { | |
| return 'nav_menu' === $id_base ? "<a href='http://example.com'>$title</a>" : $title; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment