_filter_block_template_part_area

The timeline below displays how wordpress function _filter_block_template_part_area has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Checks whether the input 'area' is a supported value.
 * Returns the input if supported, otherwise returns the 'uncategorized' value.
 *
 * @since 5.9.0
 * @access private
 *
 * @param string $type Template part area name.
 * @return string Input if supported, else the uncategorized value.
 */
function _filter_block_template_part_area($type)
{
    $allowed_areas = array_map(static function ($item) {
        return $item['area'];
    }, get_allowed_block_template_part_areas());
    if (in_array($type, $allowed_areas, true)) {
        return $type;
    }
    $warning_message = sprintf(
        /* translators: %1$s: Template area type, %2$s: the uncategorized template area value. */
        __('"%1$s" is not a supported wp_template_part area value and has been added as "%2$s".'),
        $type,
        WP_TEMPLATE_PART_AREA_UNCATEGORIZED
    );
    trigger_error($warning_message, E_USER_NOTICE);
    return WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
}

WordPress Version: 5.9

/**
 * Checks whether the input 'area' is a supported value.
 * Returns the input if supported, otherwise returns the 'uncategorized' value.
 *
 * @since 5.9.0
 * @access private
 *
 * @param string $type Template part area name.
 *
 * @return string Input if supported, else the uncategorized value.
 */
function _filter_block_template_part_area($type)
{
    $allowed_areas = array_map(static function ($item) {
        return $item['area'];
    }, get_allowed_block_template_part_areas());
    if (in_array($type, $allowed_areas, true)) {
        return $type;
    }
    $warning_message = sprintf(
        /* translators: %1$s: Template area type, %2$s: the uncategorized template area value. */
        __('"%1$s" is not a supported wp_template_part area value and has been added as "%2$s".'),
        $type,
        WP_TEMPLATE_PART_AREA_UNCATEGORIZED
    );
    trigger_error($warning_message, E_USER_NOTICE);
    return WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
}