humanmade / authorship

A modern approach to author attribution in WordPress.
GNU General Public License v3.0
66 stars 7 forks source link

Prevent errors when wp_insert_post filters send an unexpected type #131

Closed goldenapples closed 1 year ago

goldenapples commented 1 year ago

The third argument passed along with the wp_insert_post_data hook can be a number of different types.

This avoids PHP errors trying to access a WP_Post object as an array by coercing that value to an array before trying to access it.

goldenapples commented 1 year ago

Thanks, I've updated the @param annotation. Care to re-review? :pray: