Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'tribe_get_template_part_content', 'mini_cal_stop_div_spawning', 10, 5 );
- function mini_cal_stop_div_spawning( $html, $template, $file, $slug, $name ) {
- // Only interfere with the mini calendar widget
- if ( 'pro/widgets/mini-calendar-widget.php' !== $template ) return $html;
- // ... and only during ajax requests
- if ( ! defined('DOING_AJAX') || ! DOING_AJAX ) return $html;
- // Figure out which parts we want to discard and which we want to keep
- $opening_div = '<div class="tribe-mini-calendar-wrapper">';
- $closing_div = '</div>';
- $start = strpos( $html, $opening_div ) + strlen( $opening_div );
- $close = strrpos( $html, $closing_div );
- // Return the good part
- return substr( $html, $start, $close - $start );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement