WP All Export for Wordpress:如何使用 if、elseif 条件获取和更改属性数据

WP All Export for Wordpress: How to use if, elseif condition to get and change attribute data

有没有方法可以使用 wp all export php 函数来替换数据或者我们可以直接在自定义 XML 导出中使用的任何其他语句。

我需要的是实现这个逻辑

我在 XML 中有一个名为 {Conditions} 的自定义分类法,每个 post 的 return 值为“二手”“新”

值显示正确,但我需要导出的地方 XML 需要与上面不同的值,我需要在导出期间替换它们。

Logic:
If {Conditions} = "Used"
Set Used = "20";
Elseif{Conditions} = "New"
Set New = "10";

WP ALL EXPORT PLUGIN

请查看“通过 PHP 函数传递数据”文档:

"...您可以单击导出字段,然后使用“导出 PHP 函数返回的值”选项。”

https://www.wpallimport.com/documentation/export/pass-data-through-php-functions/

您可以在文档页面 (convert_conditions) 的屏幕截图中将函数名称指定到文本字段中,或者,如果 运行 自定义 XML 导出,则调用该函数来自现场的类似这样的东西:

[convert_conditions({Conditions})]

...并在函数编辑器中为字段提供函数:

function convert_conditions($cond_from_xml = null) {
    if($cond_from_xml === 'Used') {
        return '20';
    } elseif($cond_from_xml === 'New') {
        return '10';
    } else {
        return '0';
    }
}