Getting Error (Cannot modify header information) while searching pages in admin
-
I am getting this strange error
Warning: Cannot modify header information - headers already sent by (output started at /home/mananato/public_html/wp-content/plugins/widget-logic/widget_logic.php:318) in /home/mananato/public_html/wp-includes/pluggable.php on line 866
when I try to search for pages within the admin area. The website is working fine and it doesn’t have any issues. It is just in the admin area and happens only when I try to search pages.
I have put a function named is_child in my widget-logic plugin. The function is:
<?php function is_child( $parent = '' ) { global $post; $parent_obj = get_page( $post->post_parent, ARRAY_A ); $parent = (string) $parent; $parent_array = (array) $parent; if ( in_array( (string) $parent_obj['ID'], $parent_array ) ) { return true; } elseif ( in_array( (string) $parent_obj['post_title'], $parent_array ) ) { return true; } elseif ( in_array( (string) $parent_obj['post_name'], $parent_array ) ) { return true; } else { return false; } } ?>
I think this is happening because of this function as the the line mentioned in the error (318) is the line where the function starts.
I cannot figure out how to solve it so any help is appreciated.
By the way the website is Human Anatomy in case someone wants to have a look
- The topic ‘Getting Error (Cannot modify header information) while searching pages in admin’ is closed to new replies.