Advertisement
Viper007Bond

Untitled

Sep 20th, 2011
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. foreach ( $units as $key = $unit ) {
  2.     $other_units = $units;
  3.     unset( $other_units[$key] );
  4.     $other_units = array_values( $other_units );
  5.  
  6.     if ( isset ( $$unit ) && ! isset( $other_units[0] ) && ! isset( $other_units[1] ) )
  7.         return $wpdb->prepare( strtoupper( $unit ) . "( $column ) $compare %d", $$unit );
  8. }
  9.  
  10.  
  11.  
  12. if ( isset( $hour ) && ! isset( $minute ) && ! isset( $second ) {
  13.     return $wpdb->prepare( "HOUR( $column ) $compare %d", $hour );
  14. } elseif ( ! isset( $hour ) && isset( $minute ) && ! isset( $second ) {
  15.     return $wpdb->prepare( "MINUTE( $column ) $compare %d", $minute );
  16. } elseif ( ! isset( $hour ) && ! isset( $minute ) && isset( $second ) {
  17.     return $wpdb->prepare( "SECOND( $column ) $compare %d", $second );
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement