php 推荐短信和vc附加组件
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 推荐短信和vc附加组件相关的知识,希望对你有一定的参考价值。
<?php
// VC testimonial add-ons
vc_map(
array(
"name" => esc_html__( "Stock Testimonial Box", "stock-toolkit" ),
"base" => "stock_testimonial_box",
"category" => esc_html__( "Stock", "stock-toolkit"),
"params" => array(
array(
"type" => "textfield",
"heading" => esc_html__( "Title", "stock-toolkit" ),
"param_name" => "title",
"description" => esc_html__( "", "stock-toolkit" )
),
array(
"type" => "textfield",
"heading" => esc_html__( "Position / Location", "stock-toolkit" ),
"param_name" => "position",
"description" => esc_html__( "", "stock-toolkit" )
),
array(
"type" => "attach_image",
"heading" => esc_html__( "Photo", "stock-toolkit" ),
"param_name" => "photo",
"description" => esc_html__( "", "stock-toolkit" )
),
array(
"type" => "textarea",
"heading" => esc_html__( "Testiomonial", "stock-toolkit" ),
"param_name" => "desc",
"description" => esc_html__( "", "stock-toolkit" )
),
)
)
);
<?php
// Testimonial shortcode
function stock_testimonial_box_shortcode($atts, $content = null){
extract( shortcode_atts( array(
'title' => '',
'position' => '',
'desc' => '',
'photo' => '',
), $atts) );
$photo_array = wp_get_attachment_image_src($photo, 'large');
$stock_testimonial_box_desc_allowed_tags =
array(
'a' => array(
'href' => array(),
'title' => array()
),
'img' => array(
'alt' => array(),
'title' => array()
),
'br' => array(),
'em' => array(),
'strong' => array(),
'p' => array()
);
$stock_testimonial_box_markup = '
<div class="single-testimonial-box">
<img src="'.esc_url($photo_array[0]).'" alt="" />
<h3>'.esc_html($title).'<span>'.esc_html($position).'</span></h3>
'.wp_kses(wpautop($desc), $stock_testimonial_box_desc_allowed_tags).'
</div>
';
$stock_testimonial_box_markup .= '';
return $stock_testimonial_box_markup;
}
add_shortcode('stock_testimonial_box', 'stock_testimonial_box_shortcode' );
以上是关于php 推荐短信和vc附加组件的主要内容,如果未能解决你的问题,请参考以下文章
php 按钮短代码和vc附加组件
php 统计短代码和vc附加组件
php [WooCommerce Ninja Forms产品附加组件]隐藏价格附加组件等于零
php base functions.php附加组件
ios UIActivityViewController 没有附加图片发送短信
php 产品附加组件