Code Modernization: Fix PHP 8 deprecation notices for optional function parameters declared before required parameters.

As it already was not possible to pass the required parameters without also passing the optional one anyway, removing the default value for the (not so) optional parameters should not affect backward compatibility.

This change affects three functions in core:

* `get_comment_delimited_block_content()`
* `do_enclose()`
* `_wp_delete_tax_menu_item()`

Props jrf, ayeshrajans, desrosj.
Fixes #50343.

git-svn-id: https://develop.svn.wordpress.org/trunk@48794 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-08-15 13:38:52 +00:00
parent b9e5fa1077
commit 9c220ffaf7
4 changed files with 12 additions and 9 deletions

View File

@@ -1569,7 +1569,7 @@ class WP_Test_REST_Attachments_Controller extends WP_Test_REST_Post_Type_Control
$this->assertArrayNotHasKey( 'https://api.w.org/action-publish', $links );
}
protected function check_post_data( $attachment, $data, $context = 'view', $links ) {
protected function check_post_data( $attachment, $data, $context = 'view', $links = array() ) {
parent::check_post_data( $attachment, $data, $context, $links );
$this->assertArrayNotHasKey( 'content', $data );