Title: array_unshift() expects parameter 1 to be array, null given
Last modified: June 22, 2020

---

# array_unshift() expects parameter 1 to be array, null given

 *  Resolved [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/)
 * Warning in debug.log.
 * array_unshift() expects parameter 1 to be array, null given
    Type: PHP Warning
   Line: 135 File: /home/wp-content/plugins/wp-external-links/includes/admin/class-
   wpel-settings-page.php
 * Thanks

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

 *  [Manuel Rocha](https://wordpress.org/support/users/manuelrocha88/)
 * (@manuelrocha88)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13020143)
 * [@dimalifragis](https://wordpress.org/support/users/dimalifragis/) where did 
   you catch this? Can You provide the exact steps to reproduce it?
 *  Thread Starter [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13020319)
 * Hello.
 * This is showing in my debug.log, i have no idea when it happens.
 * I’m using WP 5.3.4 and PHP 7.2.x
 * I have been using your plugin for months now, no problems. This is new for some
   reason.
 *  [Manuel Rocha](https://wordpress.org/support/users/manuelrocha88/)
 * (@manuelrocha88)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13029177)
 * [@dimalifragis](https://wordpress.org/support/users/dimalifragis/) is this causing
   some sort of issue on your solution?
 *  Thread Starter [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13029307)
 * No, i do not see any problem in the links. Seems to work fine.
 *  [Manuel Rocha](https://wordpress.org/support/users/manuelrocha88/)
 * (@manuelrocha88)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13030009)
 * [@dimalifragis](https://wordpress.org/support/users/dimalifragis/), great. Anyway,
   I’m going to inform our dev team about this so they can take a look and send 
   a possible fix at the next release.
 *  [Chrisbz](https://wordpress.org/support/users/chrisbz/)
 * (@chrisbz)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13030669)
 * Hi, I am getting the same error message in the admin of a test site I am working
   on … not noticed it on other sites !
 * Warnings only shown when I visit the Add Plugins page … its repeated 4 times 
   in my case :
 * Warning: array_unshift() expects parameter 1 to be array, null given in <URLeditedForSecurity
   >/spark/wp-content/plugins/wp-external-links/includes/admin/class-wpel-settings-
   page.php on line 135
 * WP 5.4.2, PHP 7.2.31
 * I see that the install dir in [@dimalifragis](https://wordpress.org/support/users/dimalifragis/)
   isuue is possibly in a sub-dir /home/.
    Mine is also in a sub dir. could it be
   happening only if WP is installed in a sub-dir ?
 * Plugin seems to work OK … just get this warning !?!
 * Best
    Chris
 *  Thread Starter [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13030809)
 * [@chrisbz](https://wordpress.org/support/users/chrisbz/)
 * Thanks for the report, so i don’t feel alone 🙂
 * My WP is not in a subdirectory. Just FYI. Home is a directory in the root of 
   my hosting space (like public_html etc etc).
 *  [Chrisbz](https://wordpress.org/support/users/chrisbz/)
 * (@chrisbz)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13031013)
 * shame… hoped that might be a pointer to a solution. ah well.
    its more of an 
   anoyance than an a problem ! Chris
 *  [Manuel Rocha](https://wordpress.org/support/users/manuelrocha88/)
 * (@manuelrocha88)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13046588)
 * [@chrisbz](https://wordpress.org/support/users/chrisbz/) [@dimalifragis](https://wordpress.org/support/users/dimalifragis/)
   our team tried to solve the issue but couldn’t replicate on our side… Although,
   they tried to come to a solution. If you don’t mind please install this version
   and tell if the issue went away.
 * [https://u.pcloud.link/publink/show?code=XZ2RsIkZphxuWNsRmTQd6j8qEPI5OX3Obh9X](https://u.pcloud.link/publink/show?code=XZ2RsIkZphxuWNsRmTQd6j8qEPI5OX3Obh9X)
 *  [Chrisbz](https://wordpress.org/support/users/chrisbz/)
 * (@chrisbz)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13047715)
 * Oh I see …
 * You are pushing WebFactory Ltd products onto the top of the Featured & therfore
   the Reccomended Plugins lists on the Add Plugins wp-admin page
 * I have to admit I always thought that that these lists were curated by WordPress.
   org!
 * So it wont affect the running of the External Links plugin … just make the Add
   Plugin page look ugly for some people.
 * BTW: The new version didnt completely resolve the issue for me it just changed
   the error to:
 * Warning: array_merge(): Argument #2 is not an array in <dirEditedForSecurity>
   spark/wp-content/plugins/wp-external-links/includes/admin/class-wpel-settings-
   page.php on line 152
 * Chris
 *  Thread Starter [dimal](https://wordpress.org/support/users/dimalifragis/)
 * (@dimalifragis)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13052612)
 * Same as the above posted.
 * The error seems to happen in admin dashboard, when uninstalling or installing
   a new plugin.
 *  [Manuel Rocha](https://wordpress.org/support/users/manuelrocha88/)
 * (@manuelrocha88)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13054589)
 * [@dimalifragis](https://wordpress.org/support/users/dimalifragis/) [@chrisbz](https://wordpress.org/support/users/chrisbz/)
   I tried again and once again I cannot replicate.
 * Try this: [https://u.pcloud.link/publink/show?code=XZkulIkZYMTDssAwqz846RPS3DqBDk1sC24y](https://u.pcloud.link/publink/show?code=XZkulIkZYMTDssAwqz846RPS3DqBDk1sC24y)
 * I believe this one should do the job.
 *  [Chrisbz](https://wordpress.org/support/users/chrisbz/)
 * (@chrisbz)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13055515)
 * Hi, Yes that fixed the issue
    Thanks
 *  [Chrisbz](https://wordpress.org/support/users/chrisbz/)
 * (@chrisbz)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13581724)
 * Hi
    Bit late reporting this … but I was wrong and it didnt fix the issue.
 * However I think I have foundd out what the problem was… (or I am talking rubish
   below!)
 * There was another plugin (WP User Manager) that had also created a public function
   called get_option_value
 * Once I disabled the WP User Manager the problem was resolved.
 * Just a suggestion: but perhaps if you prefix your public functions with a unique
   string it might help stop stop you bumping into other plugins e.g. wpel_get_option_value
 * I actually renamed the function in WP User Manager to wpum_get_option_value as
   there was only the function and 4 calls to it in one file (\wp-user-manager\vendor\
   htmlburger\carbon-fields\core\Field\Checkbox_Field.php) and reactivated it and
   both plugins work ok now ! … just testing not workable if change gets wiped on
   next update!
 * Any chance you can confirm this is the issue ? Thanks
 * Best
    Chris
 *  Plugin Author [WebFactory](https://wordpress.org/support/users/webfactory/)
 * (@webfactory)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13582276)
 * Hi Chris,
    Yea it’s really not good to put anything into the root namespace 🙁
   I’ll see what we can do about this.

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

The topic ‘array_unshift() expects parameter 1 to be array, null given’ is closed
to new replies.

 * ![](https://ps.w.org/wp-external-links/assets/icon-256x256.png?rev=2103983)
 * [External Links - nofollow, noopener & new window](https://wordpress.org/plugins/wp-external-links/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-external-links/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-external-links/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-external-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-external-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-external-links/reviews/)

 * 15 replies
 * 4 participants
 * Last reply from: [WebFactory](https://wordpress.org/support/users/webfactory/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/array_unshift-expects-parameter-1-to-be-array-null-given/#post-13582276)
 * Status: resolved