Skip to content

Instantly share code, notes, and snippets.

@adnan360
Created January 5, 2017 01:51
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 adnan360/86f507347a1ce72b8a55055b7fb947e1 to your computer and use it in GitHub Desktop.
Save adnan360/86f507347a1ce72b8a55055b7fb947e1 to your computer and use it in GitHub Desktop.
Booked plugin - a fix plugin for the problem
<?php
/*
Plugin Name: fixme test for booked plugin
Using: place it in the plugins dir and activate from wp-admin
*/
if( ! function_exists( 'mplus_fix_query' ) )
{
function mplus_fix_query( $args ) {
// echo '<pre>'.print_r($args, true).'</pre>';
$start_timestamp = (int) $args['meta_query'][0]['value'][0];
$end_timestamp = (int) $args['meta_query'][0]['value'][1];
$start_timestamp = $start_timestamp + 1;
$end_timestamp = $end_timestamp - 1;
$args['meta_query'][0]['value'][0] = $start_timestamp;
$args['meta_query'][0]['value'][1] = $end_timestamp;
// echo '<pre>'.print_r($args, true).'</pre>';
return $args;
}
add_filter( 'booked_fe_date_content_query', 'mplus_fix_query' );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment