johnbillion / extended-cpts

A library which provides extended functionality to WordPress custom post types and taxonomies.
GNU General Public License v2.0
980 stars 96 forks source link

Conflict with Permitpress Pro, proposed solution #211

Closed JacobDB closed 1 year ago

JacobDB commented 1 year ago

I was just setting up "Permitpress Pro" for a client, and saw that the dashboard errors out when this plugin is enabled in conjunction with extended-cpts. It's due to src/PostTypeAdmin.php at line 618, requiring the type array. With Permitpress Pro enabled, this value is being passed as null. To fix this, simply adding a ? before the typecasting will allow for a null value, like so..

    public function glance_items( ?array $items ): array {

I made this change locally and the dashboard started working again. It'd be great if we could get this in an official release.

johnbillion commented 1 year ago

Thanks for the report. You'll need to report this to Permitpress because null is not an accepted type for the dashboard_glance_items filter. See https://developer.wordpress.org/reference/hooks/dashboard_glance_items/