2016-09-29 5 views
0

既存のVisual Composerプラグインの拡張機能を作成しています。 すべて正常に動作しますが、1つの変数は認識されません。 そして、なぜ私は理解できません。PHP配列の最初の変数が認識されない

if($vor_icon_style == "bg-sprechblase" || 
    $vor_icon_style == "bg-konfigurator" || 
    $vor_icon_style == "bg-koffer" || 
    $vor_icon_style == "bg-stoppuhr" || 
    $vor_icon_style == "bg-prozente" || 
    $vor_icon_style == "bg-maus" 
) 
$end_content .= '<figcaption> 
         <div> 
          <h2 style="color:'.$title_overlay_font_color.';font-size:'.$title_font_size.';">'.$header.' <span>'.$header2.'</span></h2> 
          <p style="color:'.$description_font_color.';font-size:'.$description_font_size.';">'.$content.'</p> 
         </div> 
         <a class="service websites" href="'.$href['url'].'" title="'.$href['title'].'"></a> 
        </figcaption>'; 
$end_content .= '</figure></div>'; 

return $end_content; 

およびVisual Composerで、私はこのマップを作成しました:

vc_map(array(
"base" => "vc_doo_voreingestelle_icons", 
"name" => __("Voreingestellte Icons", "doo-text-domain"), 
"icon" => "dt_vc_fashion_banner", 
'admin_enqueue_css' => array(get_template_directory_uri().'/vc_doo_banner.css'), 
'category' => __('Doo', "doo-text-domain"), 
'description' => __('Voreingestellte Icons', "doo-text-domain"), 
"params" => array(
    array(
     "type"  => "dropdown", 
     "heading"  => __("Welches Icon soll angezeigt werden?", "doo-text-domain"), 
     "param_name" => "vor_icon_style", 
     "value"  => array(
     'Sprechblase' => 'bg-sprechblase', 
     'Konfigurator' => 'bg-konfigurator', 
     'Koffer' => 'bg-koffer', 
     'Stoppuhr' => 'bg-stoppuhr', 
     'Prozente' => 'bg-prozente', 
     'Maus' => 'bg-maus', 
    ), 
     "description" => __("Bitte das Icon auswählen") 
    ), 

を[...]

そして、すべてのVor_Icon_stylesを選択してクラスを拡張することができます。 しかし、 "BG-SPRECHBLASE"ではありません。

アイデアはありますか?

Greezとありがとうございます!

答えて

0

これで、ビジュアルコンポーザーの配列の最初の変数がプレースホルダー変数であるように見えます。

だから、最初の要素として配列に説明を追加した:

vc_map(array(
"base" => "vc_doo_voreingestelle_icons", 
"name" => __("Voreingestellte Icons", "doo-text-domain"), 
"icon" => "dt_vc_fashion_banner", 
'admin_enqueue_css' => array(get_template_directory_uri().'/vc_doo_banner.css'), 
'category' => __('Doo', "doo-text-domain"), 
'description' => __('Voreingestellte Icons', "doo-text-domain"), 
"params" => array(
    array(
     "type"  => "dropdown", 
     "heading"  => __("Welches Icon soll angezeigt werden?", "doo-text-domain"), 
     "param_name" => "vor_icon_style", 
     "value"  => array(
     'Bitte auswählen' => 'bg-sprechblase', //PLACEHOLDER VARIABLE 
     'Sprechblase' => 'bg-sprechblase', 
     'Konfigurator' => 'bg-konfigurator', 
     'Koffer' => 'bg-koffer', 
     'Stoppuhr' => 'bg-stoppuhr', 
     'Prozente' => 'bg-prozente', 
     'Maus' => 'bg-maus', 
    ), 
     "description" => __("Bitte das Icon auswählen") 
    ), 

働きます。

関連する問題