Title: Fatal Error: Cannot use object of type WP_Post as array
Last modified: January 12, 2023

---

# Fatal Error: Cannot use object of type WP_Post as array

 *  Resolved [gishua](https://wordpress.org/support/users/gishua/)
 * (@gishua)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-object-of-type-wp_post-as-array/)
 * We are still using php 7.3 and this could be the cause, but here are the error
   messages when trying to upload a featured image within a post. Note: If I upload
   in the Media Library it works fine.
 * [12-Jan-2023 15:25:27 America/New_York] PHP Fatal error: Uncaught Error: Cannot
   use object of type WP_Post as array in /var/www/example.com/webroot/wp-content/
   plugins/w3-total-cache/Util_AttachToActions.php:76
   Stack trace:
 * **0 /var/www/example.com/webroot/wp-includes/class-wp-hook.php(308): W3TC\Util_AttachToActions-
   >on_pre_post_update(11653, Object(WP_Post))**
 * **1 /var/www/example.com/webroot/wp-includes/class-wp-hook.php(332): WP_Hook-
   >apply_filters(”, Array)**
 * **2 /var/www/example.com/webroot/wp-includes/plugin.php(517): WP_Hook->do_action(
   Array)**
 * **3 /var/www/example.com/webroot/wp-includes/post.php(4433): do_action(‘pre_post_update’,
   11654, Array)**
 * **4 /var/www/example.com/webroot/wp-includes/post.php(6346): wp_insert_post(Array,
   false, true)**
 * **5 /var/www/example.com/webroot/wp-includes/post.php(4802): wp_insert_attachment(
   Array, false, 0, false)**
 * **6 /var/www/example.com/webroot/wp-content/plugins/auto-image-attributes-from-
   filename-with-bulk-updater/admin/iaff_image-attributes-from-filename-do.php(720):
   wp_update_post(Array)**
 * **7 /va in /var/www/example.com/webroot/wp-content/plugins/w3-total-cache/Util_AttachToActions.
   php on line 76**

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

 *  Plugin Author [Arun Basil Lal](https://wordpress.org/support/users/arunbasillal/)
 * (@arunbasillal)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-object-of-type-wp_post-as-array/#post-16384162)
 * Hello [@gishua](https://wordpress.org/support/users/gishua/)
 * My name is Arun. Sorry for the late reply, I was under the weather for a bit.
   Happy new year.
 * I tried to replicate the error by installing W3 Total Cache and by uploading 
   an image as a featured image on a post. Couldn’t replicate it. My PHP version
   was 7.3.5.
 * Can you please disable the `Auto Image Attributes` plugin and try again please?
   This will help me confirm that the error is coming from my plugin. Currently 
   it looks like it is coming from W3 Total Cache, but I could be wrong.
 * Looking forward to your feedback.
 *  Plugin Author [Arun Basil Lal](https://wordpress.org/support/users/arunbasillal/)
 * (@arunbasillal)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-object-of-type-wp_post-as-array/#post-16416482)
 * Any update [@gishua](https://wordpress.org/support/users/gishua/)? Are you still
   able to replicate this?
 *  Thread Starter [gishua](https://wordpress.org/support/users/gishua/)
 * (@gishua)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-object-of-type-wp_post-as-array/#post-16422466)
 * Hi [@arunbasillal](https://wordpress.org/support/users/arunbasillal/), thank 
   you for your response. I have updated all plugins & tried uploading to our custom
   post types & to regular posts and it worked now. Whatever you did to adjust the
   plugin seems like it worked.
 * I will try it on the live site and let you know the results as well.
 * Thank you
 * Josh
 *  Plugin Author [Arun Basil Lal](https://wordpress.org/support/users/arunbasillal/)
 * (@arunbasillal)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-object-of-type-wp_post-as-array/#post-16422516)
 * Thanks for the update Josh 🙂
 *  Thread Starter [gishua](https://wordpress.org/support/users/gishua/)
 * (@gishua)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-object-of-type-wp_post-as-array/#post-16422639)
 * [@arunbasillal](https://wordpress.org/support/users/arunbasillal/) looks like
   it works on live as well! Thank you!
 *  Plugin Author [Arun Basil Lal](https://wordpress.org/support/users/arunbasillal/)
 * (@arunbasillal)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-object-of-type-wp_post-as-array/#post-16422762)
 * Perfect 🙂

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

The topic ‘Fatal Error: Cannot use object of type WP_Post as array’ is closed to
new replies.

 * ![](https://ps.w.org/auto-image-attributes-from-filename-with-bulk-updater/assets/
   icon-128x128.png?rev=1690261)
 * [Auto Image Attributes From Filename With Bulk Updater (Add Alt Text, Image Title For Image SEO)](https://wordpress.org/plugins/auto-image-attributes-from-filename-with-bulk-updater/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/auto-image-attributes-from-filename-with-bulk-updater/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/auto-image-attributes-from-filename-with-bulk-updater/)
 * [Active Topics](https://wordpress.org/support/plugin/auto-image-attributes-from-filename-with-bulk-updater/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/auto-image-attributes-from-filename-with-bulk-updater/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/auto-image-attributes-from-filename-with-bulk-updater/reviews/)

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)

 * 6 replies
 * 2 participants
 * Last reply from: [Arun Basil Lal](https://wordpress.org/support/users/arunbasillal/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-object-of-type-wp_post-as-array/#post-16422762)
 * Status: resolved