get_block_metadata_i18n_schema example

'keywords'        => 'keywords',
        'attributes'      => 'attributes',
        'providesContext' => 'provides_context',
        'usesContext'     => 'uses_context',
        'selectors'       => 'selectors',
        'supports'        => 'supports',
        'styles'          => 'styles',
        'variations'      => 'variations',
        'example'         => 'example',
    );
    $textdomain        = ! empty( $metadata['textdomain'] ) ? $metadata['textdomain'] : null;
    $i18n_schema       = get_block_metadata_i18n_schema();

    foreach ( $property_mappings as $key => $mapped_key ) {
        if ( isset( $metadata[ $key ] ) ) {
            $settings[ $mapped_key ] = $metadata[ $key ];
            if ( $textdomain && isset( $i18n_schema->$key ) ) {
                $settings[ $mapped_key ] = translate_settings_using_i18n_schema( $i18n_schema->$key$settings[ $key ]$textdomain );
            }
        }
    }

    $script_fields = array(
        
Home | Imprint | This part of the site doesn't use cookies.