我正在寻找一种方法,以拉(出口)产品后数据(WooCommerce)使用产品后ID的快捷码到另一个一般职位
(例如产品帖子标题/字符串)。
非常感谢。
我正在寻找一种方法,以拉(出口)产品后数据(WooCommerce)使用产品后ID的快捷码到另一个一般职位
(例如产品帖子标题/字符串)。
非常感谢。
将此代码添加到函数中。php文件,然后您可以使用[product_title id="123"]
短代码
如果需要其他产品元,可以编辑函数以返回所需的任何产品数据
/**
* Product title shortcode.
* `[product_title id="123"]` to get a specific product title, by ID
*
* @return string The post\'s title.
*/
add_shortcode( \'product_title\', function( $atts ) {
$atts = shortcode_atts( array(
\'id\' => get_the_ID(),
), $atts, \'post_title\' );
return get_the_title( absint( $atts[\'id\'] ) );
});
function my_shortcode($atts, $content = null){ extract(shortcode_atts(array(\"type\" => \"warrning\"), $atts)); return \".$content.\"; } add_shortcode(\"warrning_dialog\", \"my_shortcode\"); 我知道它会创建短代码[warning\\u dialo