WordPress.org

Forums

Issue with rewrite.php (2 posts)

  1. greenpeas
    Member
    Posted 6 years ago #

    I'm getting the error:
    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /homepages/33/d236206946/htdocs/fbcwaynesboro.org/www/wp/wp-includes/rewrite.php on line 59
    on my page
    Looking at the referenced code, I can't quite figure out how to modify it to remove the warning:
    lines 57-61 in rewrite.php

    function add_feed($feedname, $function) {
    	global $wp_rewrite;
    	if (!in_array($feedname, $wp_rewrite->feeds)) { //override the file if it is
    		$wp_rewrite->feeds[] = $feedname;
    	}
  2. eryanv
    Member
    Posted 5 years ago #

    Your add_feed function is probably occurring too early in the page construction process. I originally had my add_feed hooked into plugins_loaded, where I received this error, but when I changed it to the init hook, I no longer received this error.

Topic Closed

This topic has been closed to new replies.

About this Topic