Title: PHP warning: call_user_func_array() expects parameter 1 to be a valid callback
Last modified: August 21, 2016

---

# PHP warning: call_user_func_array() expects parameter 1 to be a valid callback

 *  [Donatto](https://wordpress.org/support/users/donatto/)
 * (@donatto)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/php-warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback/)
 * I have upgraded both WordPress and feed-json plugins.
 * Each time I use feed (but not any other) URL, I see in apache error logs file:
 * PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback,
   first array member is not a valid class name or object in /var/www/website/wp-
   includes/plugin.php on line 470
 * I checked already, it’s because of do_feed_json(). Can you fix this for later
   version?
 * Please, let me know if you need more details.
 * Versions:
    * WordPress: 3.9.1 * Feed Json: 1.0.9
 * [https://wordpress.org/plugins/feed-json/](https://wordpress.org/plugins/feed-json/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [rohnjeynolds](https://wordpress.org/support/users/rohnjeynolds/)
 * (@rohnjeynolds)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/php-warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback/#post-4906273)
 * I have the same problem, and I think the issue is in this method declaration,
   lines 81-83 of feed-json.php:
 *     ```
       static public function add_feed_json() {
         add_feed('json', array($this, 'do_feed_json'));
       }
       ```
   
 * If I remove the ‘static’ keyword, it resolves the error. This method is called
   nonstatically a few lines above in the method add_feed_json_once(), and I think
   it’s barfing because the $this variable is not available in static functions.
 * Is there a reason why add_feed_json() is declared to be static? I don’t immediately
   see any static calls to the function.
 *  [goidxmario](https://wordpress.org/support/users/goidxmario/)
 * (@goidxmario)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/php-warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback/#post-4906281)
 * I was able to resolve the issue by placing the following line under comments:
 * `//add_action( 'init', array( $this, 'add_feed_json') );`
 * then changed the function to non static as indicated by rohnjeynolds. hope that
   helps anyone else until the plugin is updated.
 *  [joumak](https://wordpress.org/support/users/joumak/)
 * (@joumak)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/php-warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback/#post-4906323)
 * The problem is that add_feed_json is marked as static method so there is no $
   this (object instance variable). Plugin uses singleton pattern, so maybe one 
   way to correct the class would be getting the instance variable with get_instance-
   method or simply drop all static methods (because there can be only one instance
   anyways).
 *  [serkanyucewp](https://wordpress.org/support/users/serkanyucewp/)
 * (@serkanyucewp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/php-warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback/#post-4906428)
 * how can i fix this problem
 * <b>Warning</b>: call_user_func_array() expects parameter 1 to be a valid callback,
   first array member is not a valid class name or object in <b>/home/bato.org.tr/
   httpdocs/wp-includes/plugin.php</b> on line <b>496</b>
 *  [carolinaa](https://wordpress.org/support/users/carolinaa/)
 * (@carolinaa)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/php-warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback/#post-4906429)
 * I removed the static keyword in public function add_feed_json() and it resolved
   the error, but im not sure if it perfect solution

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘PHP warning: call_user_func_array() expects parameter 1 to be a valid
callback’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/feed-json.svg)
 * [Feed JSON](https://wordpress.org/plugins/feed-json/)
 * [Support Threads](https://wordpress.org/support/plugin/feed-json/)
 * [Active Topics](https://wordpress.org/support/plugin/feed-json/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/feed-json/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/feed-json/reviews/)

 * 5 replies
 * 6 participants
 * Last reply from: [carolinaa](https://wordpress.org/support/users/carolinaa/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/php-warning-call_user_func_array-expects-parameter-1-to-be-a-valid-callback/#post-4906429)
 * Status: not resolved