Open
Description
Since wordpress-stubs
6.0.2 PHPstan triggers errors when we pass $args
parameter as an object to wp_update_post()
function as it's allowed.
https://github.com/WordPress/WordPress/blob/6.0.2/wp-includes/post.php#L4703-L4718
The issue is closer than @Chouby one, however it seems to us that the PHPStan documentation isn't correct in the wp_update_post()
function case.
for example
$post = get_post( $post_id );
$post->post_status = 'draft';
wp_update_post( $post );
triggers
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
178 Parameter #1 $postarr of function wp_update_post expects array{ID?: int, post_author?: int, post_date?: string, post_date_gmt?: string, post_content?: string, post_content_filtered?: string, post_title?: string, post_excerpt?: string, ...}, WP_Post given.
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Metadata
Metadata
Assignees
Labels
No labels