Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slimndap/8d0d97bc28022ae8ce24 to your computer and use it in GitHub Desktop.
Save slimndap/8d0d97bc28022ae8ce24 to your computer and use it in GitHub Desktop.
Remove the enclosing divs from the HTML of the event startdate, starttime, enddate and endtime.
<?php
/**
* Removes the enclosing div from the event startdate HTML.
*
* @param string $html The HTML.
* @param array $filters The template filters.
* @param WPT_Event $event The event.
* @return string The HTML without enclosing divs.
*/
function wpt_remove_startdate_divs($html, $filters, $event) {
return $event->startdate();
}
add_filter('wpt/event/startdate/html', 'wpt_remove_startdate_divs', 10 , 3);
/**
* Removes the enclosing div from the event starttime HTML.
*
* @param string $html The HTML.
* @param array $filters The template filters.
* @param WPT_Event $event The event.
* @return string The HTML without enclosing divs.
*/
function wpt_remove_starttime_divs($html, $filters, $event) {
return $event->starttime();
}
add_filter('wpt/event/starttime/html', 'wpt_remove_starttime_divs', 10 , 3);
/**
* Removes the enclosing div from the event enddate HTML.
*
* @param string $html The HTML.
* @param array $filters The template filters.
* @param WPT_Event $event The event.
* @return string The HTML without enclosing divs.
*/
function wpt_remove_enddate_divs($html, $filters, $event) {
return $event->enddate();
}
add_filter('wpt/event/enddate/html', 'wpt_remove_enddate_divs', 10 , 3);
/**
* Removes the enclosing div from the event endtime HTML.
*
* @param string $html The HTML.
* @param array $filters The template filters.
* @param WPT_Event $event The event.
* @return string The HTML without enclosing divs.
*/
function wpt_remove_endtime_divs($html, $filters, $event) {
return $event->endtime();
}
add_filter('wpt/event/endtime/html', 'wpt_remove_endtime_divs', 10 , 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment