Title: jQuery.isArray is deprecated; use Array.isArray
Last modified: May 11, 2021

---

# jQuery.isArray is deprecated; use Array.isArray

 *  Resolved [corpusprime](https://wordpress.org/support/users/corpusprime/)
 * (@corpusprime)
 * [5 years ago](https://wordpress.org/support/topic/jquery-isarray-is-deprecated-use-array-isarray/)
 * Hello,
    I am in version 8 of php and I have a problem of character encoding on
   your plugin that I bought on Themeforest
 * Sincerely,
 * Olivier
 * `Uncaught TypeError: htmlspecialchars(): Argument #1 ($string) must be of type
   string, array given in /homepages/44/d582119578/htdocs/preprod/wp-content/plugins/
   wordpress-popular-posts/src/template-tags.php:162 Stack trace: #0 /homepages/
   44/d582119578/htdocs/preprod/wp-content/plugins/wordpress-popular-posts/src/template-
   tags.php(162): htmlspecialchars(Array, 3, 'UTF-8', false) #1 /homepages/44/d582119578/
   htdocs/preprod/wp-content/themes/emytheme/index.php(168): wpp_get_mostpopular(
   Array) #2 /homepages/44/d582119578/htdocs/preprod/wp-includes/template-loader.
   php(106): include('/homepages/44/d...') #3 /homepages/44/d582119578/htdocs/preprod/
   wp-blog-header.php(19): require_once('/homepages/44/d...') #4 /homepages/44/d582119578/
   htdocs/preprod/index.php(17): require('/homepages/44/d...') #5 {main} thrown 
   in /homepages/44/d582119578/htdocs/preprod/wp-content/plugins/wordpress-popular-
   posts/src/template-tags.php on line 162`
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjquery-isarray-is-deprecated-use-array-isarray%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [5 years ago](https://wordpress.org/support/topic/jquery-isarray-is-deprecated-use-array-isarray/#post-14426564)
 * Hi [@corpusprime](https://wordpress.org/support/users/corpusprime/),
 * I’m sorry to say this but the official WordPress Popular Posts plugin is the 
   one you can download for free on wordpress.org or from its official GitHub repository.
   If you got the plugin from somewhere else it certainly didn’t come from me. You’ll
   need to ask whoever “sold” you a copy of the plugin to provide support for it.
 * Note that the official version has been tested with PHP 8 and so far I haven’t
   seen this error pop up.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [5 years ago](https://wordpress.org/support/topic/jquery-isarray-is-deprecated-use-array-isarray/#post-14426871)
 * By the way, the error seems to be caused by the theme (see line 168 of index.
   php in /wp-content/themes/emytheme/) and not due to a compatibility issue with
   PHP 8.
 * It seems to me that the theme is not using the [wpp_get_mostpopular()](https://github.com/cabrerahector/wordpress-popular-posts/wiki/2.-Template-tags#wpp_get_mostpopular)
   function correctly. The developer of the theme (according to the theme’s style.
   css file that’s you, right?) needs to check that they’re passing the right parameters
   in the correct format to the function, otherwise this can happen:
 * > htmlspecialchars(): Argument #1 ($string) must be of type string, **array given**

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

The topic ‘jQuery.isArray is deprecated; use Array.isArray’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

## Tags

 * [htmlspecialchars](https://wordpress.org/support/topic-tag/htmlspecialchars/)

 * 2 replies
 * 2 participants
 * Last reply from: [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/jquery-isarray-is-deprecated-use-array-isarray/#post-14426871)
 * Status: resolved