Title: Please change this code
Last modified: August 22, 2016

---

# Please change this code

 *  Resolved [BackuPs](https://wordpress.org/support/users/backups/)
 * (@backups)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/please-change-this-code/)
 * Hi
 * Please change this code on line 1231 in taxonomy_functions.php to this
 *     ```
       if(isset($taxonomy) && is_array($geodir_taxonomies) && in_array($taxonomy,$geodir_taxonomies)){
       ```
   
 * It can throw notification errors when themes have their own custom post types.
 * You need to check if the string is a array and or not empty !
 * regards !
 * [https://wordpress.org/plugins/geodirectory/](https://wordpress.org/plugins/geodirectory/)

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

 *  Plugin Author [Stiofan](https://wordpress.org/support/users/stiofansisland/)
 * (@stiofansisland)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/please-change-this-code/#post-5784626)
 * Hello,
 * I have had a look at the line in question
    `if(isset($taxonomy) && in_array($
   taxonomy,$geodir_taxonomies)){`
 * that functions is calling our own taxonomies which will never be empty if u are
   actually using GD, it has nothing to do with the theme having other taxonomies,
   however on the off chance u install GD with the intent to not use it i will ad
   a check for it 🙂
 * Thanks,
 * Stiofan
 *  Thread Starter [BackuPs](https://wordpress.org/support/users/backups/)
 * (@backups)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/please-change-this-code/#post-5784627)
 * Well somehow i get there and it is empty and the fix is easy just change the 
   code and return.
 * Why i get there or what is causing it is unknow i only see the error and i think
   its because of a filter calling the get_the_excerpt
 * it would be nice if you just add the extra statement it does not harm at all 
   checking for it.
 * So thank you for adding it.
 *  Thread Starter [BackuPs](https://wordpress.org/support/users/backups/)
 * (@backups)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/please-change-this-code/#post-5784628)
 * btw it happens in a wpms when switching blog_ids pulling blog posts from other
   subsites which are not running your plugin.
 *  Plugin Author [Stiofan](https://wordpress.org/support/users/stiofansisland/)
 * (@stiofansisland)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/please-change-this-code/#post-5784629)
 * i did add an extra check, the line is now…
 * `if(isset($taxonomy) && !empty($geodir_taxonomies) && in_array($taxonomy,$geodir_taxonomies)){`
 * and if your switching blog_id then it’s gona be checking the wrong blog for the
   taxonomies.
 * Pulling posts from other blogs is not standard, we can’t be expected to check
   for not standard WP code that will cause errors 🙂

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

The topic ‘Please change this code’ is closed to new replies.

 * ![](https://ps.w.org/geodirectory/assets/icon-256x256.jpg?rev=2778361)
 * [GeoDirectory - WP Business Directory Plugin and Classified Listings Directory](https://wordpress.org/plugins/geodirectory/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/geodirectory/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/geodirectory/)
 * [Active Topics](https://wordpress.org/support/plugin/geodirectory/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geodirectory/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geodirectory/reviews/)

## Tags

 * [change](https://wordpress.org/support/topic-tag/change/)
 * [code](https://wordpress.org/support/topic-tag/code/)
 * [needed](https://wordpress.org/support/topic-tag/needed/)
 * [Notification Error](https://wordpress.org/support/topic-tag/notification-error/)

 * 4 replies
 * 2 participants
 * Last reply from: [Stiofan](https://wordpress.org/support/users/stiofansisland/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/please-change-this-code/#post-5784629)
 * Status: resolved