亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

我如何將 HTML 代碼放入 PHP 以進行可視化作曲家插件開發?

我如何將 HTML 代碼放入 PHP 以進行可視化作曲家插件開發?

PHP
HUWWW 2021-08-28 15:56:54
我試圖盡可能地修改代碼,但我是初學者,任何幫助將不勝感激。啟動我的代碼時出現致命錯誤。此輸出有效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 代碼嵌入到我正在創建的短代碼中
查看完整描述

1 回答

?
天涯盡頭無女友

TA貢獻1831條經驗 獲得超9個贊

在您的 $output 中,用單引號替換內部雙引號或轉義雙引號。


<?php

    $o = " 'single quoute' ";

    $o_esc = " \"escaped_doublequotes\" ";


查看完整回答
反對 回復 2021-08-28
  • 1 回答
  • 0 關注
  • 111 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號