Created
January 28, 2016 23:32
-
-
Save lukecav/299e65dc2ae25f278338 to your computer and use it in GitHub Desktop.
Widget Title URL
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
| // We will make use of widget_title filter to | |
| //dynamically replace custom tags with html tags | |
| add_filter( 'widget_title', 'accept_html_widget_title' ); | |
| function accept_html_widget_title( $mytitle ) { | |
| // The sequence of String Replacement is important!! | |
| $mytitle = str_replace( '[link', '<a', $mytitle ); | |
| $mytitle = str_replace( '[/link]', '</a>', $mytitle ); | |
| $mytitle = str_replace( ']', '>', $mytitle ); | |
| return $mytitle; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment