Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter apicedda

    (@apicedda)

    Thanks a lot, you are doing much more than you should.
    I quickly tested it and looks like it’s working as intended.
    And again, thank you for your awesome work

    Thread Starter apicedda

    (@apicedda)

    or actually a more versatile %ENCODE_OPEN% %ENCODE_CLOSE% type of thing

    Thread Starter apicedda

    (@apicedda)

    Ok, i added a filter like this:
    add_filter( 'amazon_link_url', array( $this, 'apply_url_encode' ), 21, 1 );
    and then the actual function:

    function apply_url_encode($string) {
       return rawurlencode($string);
    }

    and it works as it should.

    Now what about adding a new keyword like %URL_ENCODED%?
    would it be too complicated?

    Thank you

    Thread Starter apicedda

    (@apicedda)

    That worked, thanks a lot. Unfortunatelly i’m now facing a problem. The urls inside a shortcode needs to be encoded, so an url like:
    https://www.amazon.it/
    (which is what the %URL% tag is replaced by)

    needs to be encoded to:
    https%3A%2F%2Fwww.amazon.it

    is there anything built inside the plugin to work this out? otherwise i’ll look for another solution

    Thanks for the help so far!

    Thread Starter apicedda

    (@apicedda)

    Sure. Let’s say i have a plugin which lets me create a button using a shortcode like:
    [fancy_button link=”url:SOME_URL” size=”large”]BUTTON TEXT[/fancy_button]

    i would like to use that shortcode inside a template, so something like this:
    [fancy_button link=”url:%URL%” size=”large”]%TITLE% – %PRICE%[/fancy_button]

    Let me know if it wasn’t clear and thanks for the reply.

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