Created
January 5, 2017 01:51
-
-
Save adnan360/86f507347a1ce72b8a55055b7fb947e1 to your computer and use it in GitHub Desktop.
Booked plugin - a fix plugin for the problem
This file contains hidden or 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 | |
/* | |
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