Я пытался исправить код как можно лучше, но я новичок, любая помощь будет оценена.
При запуске моего кода я получаю фатальную ошибку.
Этот вывод работает
public function renderMyBartag( $atts, $content = null ) {
extract( shortcode_atts( array(
'foo' => 'something',
'color' => '#FF0000'
), $atts ) );
$content = wpb_js_remove_wpautop($content, true); // fix unclosed/unwanted paragraph tags in $content
$output = "<div style='color:{$color};' data-foo='${foo}'>{$content}</div>";
return $output;
}
Это не
public function renderMyBartag( $atts, $content = null ) {
extract( shortcode_atts( array(
'foo' => 'something',
'color' => '#FF0000'
), $atts ) );
$content = wpb_js_remove_wpautop($content, true); // fix unclosed/unwanted paragraph tags in $content
$output = "<div class="container">
< class="learn-more">
<div class="circle">
<span class="icon arrow"></span>
</div>
<p class="button-text">{$foo}</p>
</button>
</div>"
;
return $output;
}
При запуске моего кода я получаю фатальную ошибку.
Я просто хочу встроить HTML-код в шорткод, который я создаю