Title: Undefined variable $post
Last modified: January 22, 2024

---

# Undefined variable $post

 *  Resolved [mikram4](https://wordpress.org/support/users/mikram4/)
 * (@mikram4)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/undefined-variable-post-6/)
 * Hello, my logs are spammed with every request writing a log message:
 *     ```wp-block-code
       2024/01/22 19:35:46 [error] 7053#7053: *3543971 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined variable $post in /wp-content/plugins/adminimize/adminimize.php on line 285; PHP message: PHP Warning: Attempt to read property "ID" on null in /wp-content/plugins/adminimize/adminimize.php on line 285"
       ```
   

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

 *  Plugin Contributor [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * (@bueltge)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/undefined-variable-post-6/#post-17496574)
 * Which version do you use, the last one 1.11.10? Because the property `ID` is 
   not in place in this line of code of your error log. 
   see [https://github.com/wp-media/adminimize/blob/ae8f7b0d75f6d783f2b4572e3f92fca05fb5559b/adminimize.php#L285](https://github.com/wp-media/adminimize/blob/ae8f7b0d75f6d783f2b4572e3f92fca05fb5559b/adminimize.php#L285)
 *  [afrigols](https://wordpress.org/support/users/afrigols/)
 * (@afrigols)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/undefined-variable-post-6/#post-17496745)
 * Hello,
   I have the same problem, I have the latest version of the plugin (Versión
   1.11.10) but on the adminimize.php page, on line 285 I have this line:$current_post_type
   = get_post_type($post->ID);And this causes a lot of warnings in the server error
   log.
 * Downloading the plugin and reinstalling it now works
    -  This reply was modified 2 years, 2 months ago by [afrigols](https://wordpress.org/support/users/afrigols/).

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

The topic ‘Undefined variable $post’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/adminimize_000000.svg)
 * [Adminimize](https://wordpress.org/plugins/adminimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/adminimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/adminimize/)
 * [Active Topics](https://wordpress.org/support/plugin/adminimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/adminimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/adminimize/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [afrigols](https://wordpress.org/support/users/afrigols/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/undefined-variable-post-6/#post-17496745)
 * Status: resolved