• Resolved Carlos Favre

    (@carfavre)


    Hi, I’m trying to use the function to spin text and I can’t get it to take the import variables included in the text.

    I have read the following Thread:

    https://ww.wp.xz.cn/support/topic/variable-data-not-recognized-with-nested-spintax/

    and I have tried to use the custom function you provide, but it always returns the field {localidad[1]} for example and I don’t care about the value of the csv.

    This is an example of how I am using it.

    [my_custom_spintax(“{Best places|The Best places|Top places} in {location[1]}”,array({location[1]}))]

    Please help me. Thanks !!!

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

    (@wpallimport)

    Hi @carfavre,

    For your example, you’d need to call the function like this:

    [my_custom_spintax("{Best places|The Best places|Top places} in ***PUTLOCATIONHERE***",{location[1]})]

    Then, change the “my_custom_spintax” function code to this:

    function my_custom_spintax( $text1 = '', $location ) {
    	$output = my_process_spintax( $text1 ) . ' ';	
    	$output = str_replace( "***PUTLOCATIONHERE***", $location, $output );
    	return trim( $output );
    }

    I hope that helps.

    Plugin Author WP All Import

    (@wpallimport)

    @carfavre, I’m marking this as resolved since it’s been inactive for over 1 month. Please open a new topic if you still have questions.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Variable in Spintax with function’ is closed to new replies.