• Resolved alejandronegociovivo

    (@alejandronegociovivo)


    Hi

    Im trying to import a csv with a spintax, i have a very similar issue that this topic https://ww.wp.xz.cn/support/topic/variable-data-not-recognized-with-nested-spintax/

    It doesnt recognize de variable, https://prnt.sc/6zODDjF1OCfO

    I have this 3 functions

    function my_process_spintax( $text ) {
    return preg_replace_callback( ‘/\{(((?>[^\{\}]+)|(?R))*)\}/x’, ‘my_replace_spintax’, $text );
    }

    function my_replace_spintax( $text ) {
    $text = my_process_spintax( $text[1] );
    $parts = explode( ‘|’, $text );
    return $parts[ array_rand( $parts ) ];
    }

    function my_custom_spintax( $text1 = ”, $options ) {
    $output = ”;
    $output .= my_process_spintax( $text1 ) . ‘ ‘;
    $options = ‘{‘ . implode( ‘|’, $options ) . ‘}’;
    $output .= my_process_spintax( $options );
    return trim( $output );
    }

    [my_custom_spintax({descripcin[1]},array({nombre216[1]},{rating[1]}))]

    How can i keep the variable in the spintax so wp all import can replace for the value in the csv? Can someone help me?

    Thank you so much in advance

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

    (@wpallimport)

    Hi @alejandronegociovivo,

    How can i keep the variable in the spintax so wp all import can replace for the value in the csv? Can someone help me?

    Since this is regarding a Pro feature, and we can only help with the free version in this forum, you’ll need to send this question to us via http://www.wpallimport.com/support/.

    That said, please keep in mind that we won’t be able to help with the code, we’ll only be able to check if you’re using the correct syntax to call the function in the import and that it’s executing as expected.

Viewing 1 replies (of 1 total)

The topic ‘Variables into spin’ is closed to new replies.