Title: PHP code errors
Last modified: August 7, 2025

---

# PHP code errors

 *  Resolved [Noel Kelly](https://wordpress.org/support/users/noel-kelly/)
 * (@noel-kelly)
 * [10 months ago](https://wordpress.org/support/topic/php-code-errors-2/)
 * PHP message: PHP Warning: Attempt to read property “post_type” on null in /www/
   visualartistsireland40_315/public/wp-content/plugins/advanced-post-block-pro/
   includes/admin/CustomPost.php on line 116″
 * That PHP warning means your site is trying to access a property (`post_type`)
   on a **null object**, which usually means that no post was available when the
   code expected one.🔍 Breakdown of the Error
    - **Plugin**: `Advanced Post Block Pro`
    - **File**: `/includes/admin/CustomPost.php`
    - **Line**: `116`
    - **Message**: “Attempt to read property ‘post_type’ on null”
 * This usually happens when the plugin calls something like:
 * php
 * `$post_type = $post->post_type;`
 * …but `$post` is `null` at that moment — maybe because the code runs **outside
   the WordPress loop** or **before global `$post` is set**.
 * Can this be fixed as our error logs are filling up with Advanced Post Block Pro
   errors.

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

 *  Plugin Author [Charles Cormier](https://wordpress.org/support/users/charlescormier/)
 * (@charlescormier)
 * [9 months, 3 weeks ago](https://wordpress.org/support/topic/php-code-errors-2/#post-18601324)
 * Hi [@noel-kelly](https://wordpress.org/support/users/noel-kelly/),
 * We are working on it. And fixing it soon…
 * Thanks for your patience!
 *  Plugin Author [Charles Cormier](https://wordpress.org/support/users/charlescormier/)
 * (@charlescormier)
 * [9 months, 2 weeks ago](https://wordpress.org/support/topic/php-code-errors-2/#post-18607620)
 * Hi [@noel-kelly](https://wordpress.org/support/users/noel-kelly/),
 * We fixed the issue and released a new version. Please update the plugin to the
   new version.
   Thank you!

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

The topic ‘PHP code errors’ is closed to new replies.

 * ![](https://ps.w.org/advanced-post-block/assets/icon-256x256.png?rev=3469085)
 * [Advanced Post Block – Showcase Posts with Grid, List, Card Layouts and Filters](https://wordpress.org/plugins/advanced-post-block/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-post-block/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-post-block/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-post-block/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-post-block/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-post-block/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Charles Cormier](https://wordpress.org/support/users/charlescormier/)
 * Last activity: [9 months, 2 weeks ago](https://wordpress.org/support/topic/php-code-errors-2/#post-18607620)
 * Status: resolved