Title: Code error
Last modified: June 29, 2019

---

# Code error

 *  Resolved [apartmentsforrentx](https://wordpress.org/support/users/apartmentsforrentx/)
 * (@apartmentsforrentx)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/code-error-27/)
 * Help please…
 * [29-Jun-2019 02:32:52 UTC] PHP Warning: array_key_exists(): The first argument
   should be either a string or an integer in /wp-content/plugins/related-post/includes/
   functions.php on line 74
 * 74 if($display_auto==’yes’ && array_key_exists($post_type, $post_types)){
    75
   76 $html .= do_shortcode(‘[related_post]’); 77 78 }
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcode-error-27%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [PickPlugins](https://wordpress.org/support/users/pickplugins/)
 * (@pickplugins)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/code-error-27/#post-11689805)
 * HI, can you please check the latest version and see the result.
 * Let me know the update.
 * Regards
 *  Thread Starter [apartmentsforrentx](https://wordpress.org/support/users/apartmentsforrentx/)
 * (@apartmentsforrentx)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/code-error-27/#post-11692690)
 * Hello, tnx for the response. Here is the error after updating today.
 * [02-Jul-2019 12:37:59 UTC] PHP Warning: array_key_exists(): The first argument
   should be either a string or an integer in /wp-content/plugins/related-post/includes/
   functions.php on line 74
 * And the code was
 * 72 $html .= $content;
    73 74 if($display_auto==’yes’ && array_key_exists($post_type,
   $post_types)){ 75 76 $html .= do_shortcode(‘[related_post]’); 77 78 }
 *  return $html;
 *  }
    -  This reply was modified 6 years, 9 months ago by [apartmentsforrentx](https://wordpress.org/support/users/apartmentsforrentx/).
 *  Plugin Author [PickPlugins](https://wordpress.org/support/users/pickplugins/)
 * (@pickplugins)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/code-error-27/#post-11693779)
 * Have you tried with using a different version of PHP on your server?
    Can you
   please try and let me know the result.
 * Regards
 *  Thread Starter [apartmentsforrentx](https://wordpress.org/support/users/apartmentsforrentx/)
 * (@apartmentsforrentx)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/code-error-27/#post-11706119)
 * Hi, sorry for the delayed response due to a recent seminar. Regarding the issue,
   yeah I tried downngrading from 7.3 to 7.1 version. Nothing has changed. Is there
   a code missing somewhere? Do I need to tweak it or need to insert code somewhere?
   Also, how can I turn the post title into it’s link as well. As of now only the
   thumbnail can be used to click the related post but the title.
    -  This reply was modified 6 years, 9 months ago by [apartmentsforrentx](https://wordpress.org/support/users/apartmentsforrentx/).
 *  Plugin Author [PickPlugins](https://wordpress.org/support/users/pickplugins/)
 * (@pickplugins)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/code-error-27/#post-11714796)
 * HI, can you please send me the URL where you are trying to display related post?
   
   there might be `get_post_type( get_the_ID() )` doesn’t work or return properly
   where you are trying to display related post dynamically.
 * Regards
 *  Thread Starter [apartmentsforrentx](https://wordpress.org/support/users/apartmentsforrentx/)
 * (@apartmentsforrentx)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/code-error-27/#post-11722345)
 * Hi, here is a sample link [https://apartmentsforrentx.com/rent/studio-type-near-rizal-makati/](https://apartmentsforrentx.com/rent/studio-type-near-rizal-makati/)
 *  Thread Starter [apartmentsforrentx](https://wordpress.org/support/users/apartmentsforrentx/)
 * (@apartmentsforrentx)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/code-error-27/#post-11728457)
 * Hi, thanks for patiently helping me out. Problem still exist after re-installation
   and cleaning the tables.
 * > [View post on imgur.com](https://imgur.com/OF8fRZs)
 * I asked permission from my clients, for me to give a temporary access since I
   am bound into a contract. However they refuse my request. Though I still don’t
   understand their sentiment despite the site still under the development stage.
   But still, thanks for the help. I guess I would have to endure the notifications
   for the meantime. I’ll just reach out again if something serious affected the
   site from this error. I, have rated the plugin 5stars by the way for the support.
   Hoping that it can be fixed on future updates despite the limitation for troubleshooting
   due to that permission for temp access to the site. Have a good day.
 *  Plugin Author [PickPlugins](https://wordpress.org/support/users/pickplugins/)
 * (@pickplugins)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/code-error-27/#post-11728784)
 * Thanks for your understanding, i would definitely fix the issue, i will waiting
   for other user feedback on this issue.
 * Many thanks for your five-star reviews.
 * Regards
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [6 years, 5 months ago](https://wordpress.org/support/topic/code-error-27/#post-12084850)
 * [@pickplugins](https://wordpress.org/support/users/pickplugins/) I’ve deleted
   your offer to login to your user’s site. I’m am 100% sure you mean well but please
   _never ask for credentials._ I have flagged your account temporarily. That just
   means that your post will need to be approved and @ notifications from you will
   not work.
 * [https://wordpress.org/support/guidelines/#the-bad-stuff](https://wordpress.org/support/guidelines/#the-bad-stuff)
 * Now for the why: The internet is a wonderful place full of very nice people and
   a few very bad ones. I’m sure everyone here is very nice however, by giving some
   ones keys to your house you are trusting they wont steal anything. Likewise the
   person who takes the keys is now responsible for the house FOREVER.
 * If something was to go wrong, then you the author may well legally become liable
   for damages, which they would not normally have been as their software is provided
   without warranty.
 * **Please be aware that repeatedly asking for credentials will result in us asking
   you to repeatedly stop before escalating up to the plugins team.**

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

The topic ‘Code error’ is closed to new replies.

 * ![](https://ps.w.org/related-post/assets/Icon-256x256.png?rev=2982985)
 * [Related Posts By PickPlugins](https://wordpress.org/plugins/related-post/)
 * [Support Threads](https://wordpress.org/support/plugin/related-post/)
 * [Active Topics](https://wordpress.org/support/plugin/related-post/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/related-post/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/related-post/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/code-error-27/#post-12084850)
 * Status: resolved