WordPress.org

Make WordPress Core

Ticket #50343: 50343.patch

File 50343.patch, 3.2 KB (added by ayeshrajans, 18 months ago)

This patch fixes the 6 deprecation notices related to function parameter order (https://php.watch/versions/8.0/deprecate-required-param-after-optional)

  • src/wp-includes/blocks.php

    diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php
    index 422b75e945..15a667bdbe 100644
    a b function strip_core_block_namespace( $block_name = null ) { 
    188188 * @param string $content    Block save content.
    189189 * @return string Comment-delimited block content.
    190190 */
    191 function get_comment_delimited_block_content( $block_name = null, $block_attributes, $block_content ) {
     191function get_comment_delimited_block_content( $block_name = null, $block_attributes = array(), $block_content = '' ) {
    192192        if ( is_null( $block_name ) ) {
    193193                return $block_content;
    194194        }
  • src/wp-includes/functions.php

    diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
    index 35c1e2e2f3..b44909a794 100644
    a b function wp_extract_urls( $content ) { 
    828828 *
    829829 * @global wpdb $wpdb WordPress database abstraction object.
    830830 *
    831  * @param string         $content Post content. If `null`, the `post_content` field from `$post` is used.
    832  * @param int|WP_Post    $post    Post ID or post object.
     831 * @param string           $content Post content. If `null`, the `post_content` field from `$post` is used.
     832 * @param int|WP_Post|null $post    Post ID or post object.
    833833 * @return null|bool Returns false if post is not found.
    834834 */
    835 function do_enclose( $content = null, $post ) {
     835function do_enclose( $content = null, $post = null ) {
    836836        global $wpdb;
    837837
    838838        // @todo Tidy this code and make the debug code optional.
  • src/wp-includes/nav-menu.php

    diff --git a/src/wp-includes/nav-menu.php b/src/wp-includes/nav-menu.php
    index e786d786db..570026ac88 100644
    a b function _wp_delete_post_menu_item( $object_id = 0 ) { 
    10541054 * @since 3.0.0
    10551055 * @access private
    10561056 *
    1057  * @param int    $object_id Optional. The ID of the original object being trashed. Default 0.
    1058  * @param int    $tt_id     Term taxonomy ID. Unused.
    1059  * @param string $taxonomy  Taxonomy slug.
     1057 * @param int      $object_id Optional. The ID of the original object being trashed. Default 0.
     1058 * @param int|null $tt_id     Term taxonomy ID. Unused.
     1059 * @param string   $taxonomy  Taxonomy slug.
    10601060 */
    1061 function _wp_delete_tax_menu_item( $object_id = 0, $tt_id, $taxonomy ) {
     1061function _wp_delete_tax_menu_item( $object_id = 0, $tt_id = null, $taxonomy = '' ) {
    10621062        $object_id = (int) $object_id;
    10631063
    10641064        $menu_item_ids = wp_get_associated_nav_menu_items( $object_id, 'taxonomy', $taxonomy );
  • tests/phpunit/tests/rest-api/rest-attachments-controller.php

    diff --git a/tests/phpunit/tests/rest-api/rest-attachments-controller.php b/tests/phpunit/tests/rest-api/rest-attachments-controller.php
    index f6adcf78c8..f88f120cd9 100644
    a b public function tearDown() { 
    15521552                $this->remove_added_uploads();
    15531553        }
    15541554
    1555         protected function check_post_data( $attachment, $data, $context = 'view', $links ) {
     1555        protected function check_post_data( $attachment, $data, $context = 'view', $links = array() ) {
    15561556                parent::check_post_data( $attachment, $data, $context, $links );
    15571557
    15581558                $this->assertArrayNotHasKey( 'content', $data );