Title: class-wp-xmlrpc-server.php &#8211; array_unshift() expects parameter 1 to be array
Last modified: September 13, 2016

---

# class-wp-xmlrpc-server.php – array_unshift() expects parameter 1 to be array

 *  [MarkRH](https://wordpress.org/support/users/markrh/)
 * (@markrh)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/class-wp-xmlrpc-server-php-array_unshift-expects-parameter-1-to-be-array/)
 * Complete warning is:
 * [12-Sep-2016 19:34:53 America/Chicago] PHP Warning: array_unshift() expects parameter
   1 to be array, null given in /(path)/wp-includes/class-wp-xmlrpc-server.php on
   line 596
 * I have never seen this warning until version 4.6.1.
 * This is where it happens in the code:
 *     ```
       	public function wp_getUsersBlogs( $args ) {
       		// If this isn't on WPMU then just use blogger_getUsersBlogs
       		if ( !is_multisite() ) {
       			array_unshift( $args, 1 );
       			return $this->blogger_getUsersBlogs( $args );
       		}
       ```
   
 * Any ideas on what might be causing it?
 * I suspect normal use of the blog doesn’t cause it, but probably some bot trying
   to do something hinky. I’ve only seen it a couple times.
    -  This topic was modified 9 years, 8 months ago by [MarkRH](https://wordpress.org/support/users/markrh/).

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

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/class-wp-xmlrpc-server-php-array_unshift-expects-parameter-1-to-be-array/#post-8176214)
 * What did you do before this issue happened? For example:
    – Did you update WP?
   Yes? Was it auto update or manual update? Also, updated from what version? – 
   Did you install/update plugins? – Did you install/update theme? – What theme 
   are you using currently? Where did you download it from? – Are ALL your plugins
   and the current theme up to date? – Have you moved your site to new server, new
   domain, or new directory – Did your site work without any issue before (No hacking,
   no error, etc.)? – Have you checked your server error logs for any clue or any
   specific error? – [http://codex.wordpress.org/Forum_Welcome#Include_as_Much_Information_as_Possible](http://codex.wordpress.org/Forum_Welcome#Include_as_Much_Information_as_Possible)
 *  Thread Starter [MarkRH](https://wordpress.org/support/users/markrh/)
 * (@markrh)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/class-wp-xmlrpc-server-php-array_unshift-expects-parameter-1-to-be-array/#post-8176242)
 * I updated manually from version 4.6 to 4.6.1. Jetpack also updated around the
   same time to v4.3.1. Using Twenty Twelve child theme which has not been updated
   since version 4.5 of WordPress but it is the current version.
 * I’ll probably go edit that code and add some logging to find out what specific
   URL requests are causing it so I can duplicate it at will.
 *  [kirai](https://wordpress.org/support/users/kirai/)
 * (@kirai)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/class-wp-xmlrpc-server-php-array_unshift-expects-parameter-1-to-be-array/#post-8245650)
 * I also have a very similar warning on my site error.log . Also the same day.
 *     ```
       [12-Sep-2016 13:18:40 UTC] PHP Warning:  array_unshift() expects parameter 1 to be array, null given in /home/*/public_html/wp-includes/class-wp-xmlrpc-server.php on line 596
       [17-Sep-2016 05:51:35 America/Chicago] PHP Warning:  require(ABSPATHwp-includes/load.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/*/public_html/wp-settings.php on line 21
       ```
   
 *  Thread Starter [MarkRH](https://wordpress.org/support/users/markrh/)
 * (@markrh)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/class-wp-xmlrpc-server-php-array_unshift-expects-parameter-1-to-be-array/#post-8246250)
 * I haven’t seen the error again since then. That file has been accessed a lot 
   though, through xmlrpc.php most likely.
 *  [dubsy](https://wordpress.org/support/users/dubsy/)
 * (@dubsy)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/class-wp-xmlrpc-server-php-array_unshift-expects-parameter-1-to-be-array/#post-8304819)
 * I’ve seen this error too
 *  [elindydotcom](https://wordpress.org/support/users/elindydotcom/)
 * (@elindydotcom)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/class-wp-xmlrpc-server-php-array_unshift-expects-parameter-1-to-be-array/#post-8341204)
 * Just saw it in log files – occurred two days ago so don’t really know what I 
   was doing at the time.
 *  [orlov0562](https://wordpress.org/support/users/orlov0562/)
 * (@orlov0562)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/class-wp-xmlrpc-server-php-array_unshift-expects-parameter-1-to-be-array/#post-8362261)
 * Hi there,
 * It’s old error, that happens because this method has not additional check for
   input variables.
 * It’s wp core devs fault.
 * You can fix it in next way:
    file: /wp-includes/class-wp-xmlrpc-server.php line:
   ~ 596 Append type check of $args variable
 *     ```
       	public function wp_getUsersBlogs( $args ) {
   
                       if (!is_array($args)) {
                           return $this->error;
                       }
       ```
   
 *  [orlov0562](https://wordpress.org/support/users/orlov0562/)
 * (@orlov0562)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/class-wp-xmlrpc-server-php-array_unshift-expects-parameter-1-to-be-array/#post-8362284)
 * JFYI: the discussion of this bug is here: [https://core.trac.wordpress.org/ticket/29750](https://core.trac.wordpress.org/ticket/29750)

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

The topic ‘class-wp-xmlrpc-server.php – array_unshift() expects parameter 1 to be
array’ is closed to new replies.

## Tags

 * [PHP Warning](https://wordpress.org/support/topic-tag/php-warning/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 6 participants
 * Last reply from: [orlov0562](https://wordpress.org/support/users/orlov0562/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/class-wp-xmlrpc-server-php-array_unshift-expects-parameter-1-to-be-array/#post-8362284)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
