Open
Description
wp_insert_post()
is expecting slashed data. So I'm used to prepare data passed to wp_insert_post()
and wp_update_post()
with wp_slash()
.
Here is a small sample to demonstrate the issue:
$post = get_post( $post_id, ARRAY_A );
$post['post_status'] = 'draft';
wp_update_post( wp_slash( $post ) );
Since the version 6.0.2 (I suppose since #49), PHPStan reports the following error on:
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, ...},
array<string, string> given.
If I remove wp_slash()
, PHPstan would report nothing.
Metadata
Metadata
Assignees
Labels
No labels