Make WordPress Core


Ignore:
Timestamp:
08/15/2020 01:38:52 PM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks.php

    r48629 r48794  
    398398 * @since 5.3.1
    399399 *
    400  * @param string $block_name       Block name.
    401  * @param array  $block_attributes Block attributes.
    402  * @param string $block_content    Block save content.
     400 * @param string|null $block_name       Block name. Null if the block name is unknown,
     401 *                                      e.g. Classic blocks have their name set to null.
     402 * @param array       $block_attributes Block attributes.
     403 * @param string      $block_content    Block save content.
    403404 * @return string Comment-delimited block content.
    404405 */
    405 function get_comment_delimited_block_content( $block_name = null, $block_attributes, $block_content ) {
     406function get_comment_delimited_block_content( $block_name, $block_attributes, $block_content ) {
    406407    if ( is_null( $block_name ) ) {
    407408        return $block_content;
Note: See TracChangeset for help on using the changeset viewer.