[Geschlossen] Text in ACF (Advanced Custom Fields) blocks is not being translated when Shortcode is being used in ...
Dies ist das technische Support-Forum für WPML – das mehrsprachige WordPress-Plugin.
Mitlesen können alle, doch nur WPML-Kunden können hier Fragen veröffentlichen. Das WPML-Team antwortet im Forum an 6 Tagen pro Woche, 22 Stunden am Tag.
Sun
Mon
Tue
Wed
Thu
Fri
Sat
-
8:00 – 13:00
9:00 – 13:00
9:00 – 13:00
8:00 – 12:00
8:00 – 12:00
-
-
14:00 – 17:00
14:00 – 18:00
14:00 – 18:00
13:00 – 17:00
13:00 – 17:00
-
Unterstützt die Zeitzone: Europe/Zagreb (GMT+02:00)
Hintergrund des Themas:
I am trying to translate text in ACF (Advanced Custom Fields) blocks, but the text is not being translated when a shortcode is used in the same field. You can see the issue on this page: versteckter Link section "Table reservation (possible from 2 persons)"
Die Symptome:
The text, both normal and button text from the shortcode, is not being translated.
Fragen:
Why is the text in ACF blocks not being translated when using a shortcode?
How can I ensure that both normal text and button text from shortcodes are translated?
i created the field group and i'll put content in it but
We use ACF Pro and we got a custom block.
<?php
/**
* voncontent Block Template.
*
* @param array $block The block settings and attributes.
* @param string $content The block inner HTML (empty).
* @param bool $is_preview True during AJAX preview.
* @param (int|string) $post_id The post ID this block is saved to.
*/
There is a File Manager available on versteckter Link
We could go through:
// Add this to your theme's `functions.php` file or a custom plugin.
function register_acf_block_types() {
// Check if function exists.
if( function_exists('acf_register_block_type') ) {
// Register a custom block.
acf_register_block_type(array(
'name' => 'voncontent',
'title' => __('Voncontent Block'),
'description' => __('A custom block for displaying content.'),
'render_template' => 'template-parts/blocks/voncontent/voncontent.php', // Adjust the path as necessary
'category' => 'formatting',
'icon' => 'admin-comments',
'keywords' => array( 'voncontent', 'content', 'custom' ),
'supports' => array(
'align' => true,
'mode' => false,
),
));
}
}
add_action('acf/init', 'register_acf_block_types');
And add voncontent.php, inside a folder such as template-parts/blocks/voncontent/ within the theme.
However our sandboxes don't have FTP access, only File Manager plugin (so if we make syntax error it would take the site down) so if you think it would be simpler for to you to upload your theme by all means.
Let me know!
Das Thema '[Geschlossen] Text in ACF (Advanced Custom Fields) blocks is not being translated when Shortcode is being used in …' ist für neue Antworten geschlossen.
Cookie-Zustimmung verwalten
Wir verwenden Cookies, um unsere Website und Dienste zu optimieren. Ihre Zustimmung erlaubt es uns, Daten wie das Durchsuchen der Website zu verarbeiten. Wenn Sie nicht zustimmen, können einige Funktionen beeinträchtigt werden.
Funktionell
Immer aktiv
Erforderlich für den Betrieb und die korrekte Kommunikation auf unserer Website.
Präferenzen
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistiken
Wir verwenden diese, um die Statistiken unserer Website zu analysieren. Die gesammelten Informationen sind völlig anonym. Der technische Speicher oder Zugriff, der ausschließlich zu anonymen statistischen Zwecken verwendet wird. Ohne eine Vorladung, die freiwillige Einhaltung durch Ihren Internetdienstanbieter oder zusätzliche Aufzeichnungen von Dritten können die zu diesem Zweck gespeicherten oder abgerufenen Informationen in der Regel nicht dazu verwendet werden, Sie zu identifizieren.
Marketing
Diese Cookies verfolgen Ihr Surfverhalten, um für Sie relevante Werbung anzuzeigen.