最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - How to create loop inside wordpress function?

programmeradmin1浏览0评论

I am using the following function to add variables to a plugin:

function fuekb_register_variable_replacements( $var, $email_data, $fue_email, $queue_item ) {

$variables['testvar'] = get_the_title($email_data['product_id']);


$var->register( $variables );
}

add_action( 'fue_before_variable_replacements', 'fuekb_register_variable_replacements', 10, 4);

The variable testvar is getting registered using this function. This is working fine for orders with single products, but when there are more than 1 products, it lists only the 1st product. How to create a foreach loop inside this function for all products in the order?

发布评论

评论列表(0)

  1. 暂无评论