WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/12/2020 08:18:08 PM (10 months ago)
Author:
johnbillion
Message:

General: Convert wp_array_get() to a "private" function and add tests.

This function may be promoted in the future if it's deemed useful enough.

Props dd32, jorgefilipecosta, Hareesh Pillai

Fixes #51720

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-supports/typography.php

    r49226 r49580  
    1616    $has_font_size_support = false;
    1717    if ( property_exists( $block_type, 'supports' ) ) {
    18         $has_font_size_support = wp_array_get( $block_type->supports, array( '__experimentalFontSize' ), false );
     18        $has_font_size_support = _wp_array_get( $block_type->supports, array( '__experimentalFontSize' ), false );
    1919    }
    2020
    2121    $has_line_height_support = false;
    2222    if ( property_exists( $block_type, 'supports' ) ) {
    23         $has_line_height_support = wp_array_get( $block_type->supports, array( '__experimentalLineHeight' ), false );
     23        $has_line_height_support = _wp_array_get( $block_type->supports, array( '__experimentalLineHeight' ), false );
    2424    }
    2525
     
    5757    $styles                = array();
    5858    if ( property_exists( $block_type, 'supports' ) ) {
    59         $has_font_size_support = wp_array_get( $block_type->supports, array( 'fontSize' ), false );
     59        $has_font_size_support = _wp_array_get( $block_type->supports, array( 'fontSize' ), false );
    6060    }
    6161
    6262    $has_line_height_support = false;
    6363    if ( property_exists( $block_type, 'supports' ) ) {
    64         $has_line_height_support = wp_array_get( $block_type->supports, array( 'lineHeight' ), false );
     64        $has_line_height_support = _wp_array_get( $block_type->supports, array( 'lineHeight' ), false );
    6565    }
    6666
Note: See TracChangeset for help on using the changeset viewer.