3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); /** * Trashes or deletes a post or page. * * When the post and page is permanently deleted, everything that is tied to * it is deleted also. This includes comments, post meta fields, and terms * associated with the post. * * The post or page is moved to Trash instead of permanently deleted unless * Trash is disabled, item is already in the Trash, or $force_delete is true. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * @see wp_delete_attachment() * @see wp_trash_post() * * @param int $post_id Optional. Post ID. Default 0. * @param bool $force_delete Optional. Whether to bypass Trash and force deletion. * Default false. * @return WP_Post|false|null Post data on success, false or null on failure. */ function wp_delete_post( $post_id = 0, $force_delete = false ) { echo '$post_id === '; var_dump( $post_id ); } wp_delete_post( '123' );
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
$post_id === string(3) "123"

preferences:
52.01 ms | 406 KiB | 5 Q