php - How to create loop inside wordpress function?

I am using the following function to add variables to a plugin: function fuekb_register_variable_replacements( $var, $em

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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745353413a4623973.html

相关推荐

  • php - How to create loop inside wordpress function?

    I am using the following function to add variables to a plugin: function fuekb_register_variable_replacements( $var, $em

    7小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信