Created
January 23, 2015 22:17
-
-
Save LinzardMac/95b29bf0a096d17bab92 to your computer and use it in GitHub Desktop.
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
$myposts = get_posts( $args ); | |
$fri = date('Y-m-d',strtotime('friday this week')); | |
$sat = date('Y-m-d',strtotime('saturday this week')); | |
$sun = date('Y-m-d',strtotime('sunday next week')); | |
// one of the posts dumped in this has the "single date" array | |
var_dump($myposts); | |
foreach ( $myposts as $post ) : setup_postdata( $post ); | |
$customdates = get_post_meta($post->ID,'custom_date', true); | |
//$customdates is what is tossing the error | |
foreach ($customdates as $eventday) | |
{ | |
switch ($eventday) { | |
case $fri: | |
$friray[]=$post->ID; | |
break; | |
case $sat: | |
$satray[]=$post->ID; | |
break; | |
case $sun: | |
$sunray[]=$post->ID; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment