Executing Custom PHP Functions

You can execute any PHP function (native functions, or user-defined functions) from inside any text box (post title, post content, Custom Field values, etc.) of WP All Import. You can pass values from your data file to the PHP function.

Example 1 – using the native str_replace function to remove commas

[str_replace(",", "", {your_price_element[1]})]

Note the use of the double quotes instead of single quotes. You must use double quotes when executing PHP functions from within WP All Import. You can’t use single quotes.

Example 2 – using a user defined function

Inside WP All Import:

[my_custom_function({my_element[1]})]

Inside your theme’s functions.php file:

function my_custom_function($x) {
    // do something to $x
    return $x;
}