• Resolved libellulas

    (@libellulas)


    Hi,
    I am using all import plugin with real homes add-on.

    I want wp-all-import to set the featured properties if the node “Frazione” is equal to “Collina”.

    So i generate this php function:

    function my_set_featured( $frazione ) {
    if ( $frazione == “Collina” ) {
    return “yes”;
    } else {
    return “no”;
    }
    }

    And I set the featured property based on xPath code with the function:

    [my_set_featured({frazione[1]})]

    If I put the code inside the content box the preview of the function works, but when I I import the properties no properties has featured checked.

    Can you help me?
    Thanks!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @libellulas

    You actually need to import “0” for no and “1” for yes, so you should be able to fix this by changing your code to:

    function my_set_featured( $frazione ) {
    	if ( $frazione == "Collina" ) {
    		return "1";
    	} else {
    		return "0";
    	}
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Featured with XPath’ is closed to new replies.