';
}
return $output;
}
/**
* Render the News Ticker module.
*
* @param array $attrs Module attributes.
* @param string $content Inner content.
* @param \WP_Block $block Block instance.
* @param object $elements Elements helper.
*
* @return string
*/
public static function render_callback($attrs, $content, $block, $elements)
{
$use_title = self::get_attr($attrs, 'module.advanced.useTitle', 'on');
$title_text = DynamicValue::resolve(self::get_attr($attrs, 'module.advanced.titleText', ''));
// A cleared Title Text printed an empty title box, which keeps its
// padding and background (#112). The builder showed "Breaking News"
// in the same case (#91). Both now leave the box out.
$title_html = '';
if ('on' === $use_title && TextValue::visible($title_text)) {
$title_html = sprintf('
%1$s
', esc_html($title_text));
}
// WCAG 2.2.2 (Pause, Stop, Hide): the ticker scrolls automatically and
// indefinitely, so it must offer a way to stop it. frontend.js toggles
// `.dtq-news-tricker--paused`, which halts the CSS animation.
$pause_html = sprintf(
'',
esc_attr__('Pause the scrolling news ticker', 'addons-for-divi')
);
$children = sprintf(
'