Created
June 30, 2016 22:01
-
-
Save cliffordp/7c6f0fcca3fe7dab47c23e1726a9ecbe to your computer and use it in GitHub Desktop.
Only display the Event Categories, do NOT link them -- i.e. strip Event Categories of their links -- Details section of Single Event pages
This file contains 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
<?php | |
/** | |
* From https://gist.github.com/cliffordp/7c6f0fcca3fe7dab47c23e1726a9ecbe | |
* | |
* Only display the Event Categories, do NOT link them | |
* i.e. strip Event Categories of their links | |
* Details section of Single Event pages | |
**/ | |
add_filter( 'tribe_get_event_categories', 'cliff_display_but_not_link_event_cats' ); | |
function cliff_display_but_not_link_event_cats( $html ) { | |
$new_html = preg_replace( '/<a href=\"(.*?)\">(.*?)<\/a>/', "\\2", $html ); // from http://www.stumiller.me/code-snippet-strip-links-from-string-in-php/ | |
return $new_html; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment