Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Created June 30, 2016 22:01
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cliffordp/7c6f0fcca3fe7dab47c23e1726a9ecbe to your computer and use it in GitHub Desktop.
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
<?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