Created
July 28, 2015 11:11
-
-
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.
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 | |
/** | |
* 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