ERROR with get_posts within meta_box
-
I just developed a plugig that adds a Meta Box to a custom post type with some checkboxs (that are other custom post types, the title is the label of the checkbox).
I query the posts like this:
<?php global $post; $tmp_post = $post; $args = array( 'post_type' => 'evento', 'posts_per_page' => -1, 'order' => 'ASC'); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <input type="checkbox" class="event-day" name="<?php the_ID(); ?>" id="<?php the_ID(); ?>" /><?php echo get_the_translated_date (get_different_type_facts(get_the_ID(), 'heading'), 'j F'); ?><br /> <?php endforeach; ?> <?php $post = $tmp_post;?>
And locally there is no problem, but with the website on the server, at every update or creation of the post I get these errors:
Warning: array_map() [function.array-map]: Argument #2 should be an array in /home/content/83/8177083/html/wp-includes/post.php on line 1684
Warning: Cannot modify header information – headers already sent by (output started at …/html/wp-includes/post.php:1684) in …/html/wp-includes/pluggable.php on line 934
What could it be??
THANKS!
- The topic ‘ERROR with get_posts within meta_box’ is closed to new replies.