• Resolved selenaquintanilla

    (@selenaquintanilla)


    Hello,

    I’m currently using the HurryTimer plugin and have encountered an issue where my custom shortcode [current_slug] is not being replaced with the page slug when used within the plugin’s URL fields.
    This shortcode works elsewhere on my site, but it seems that HurryTimer is not processing it in this context.
    Is there a specific filter or method within HurryTimer that allows for shortcode processing in URL settings or other non-standard content areas?
    ( I use this shortcode send parameter to the targer url)

    Any guidance you can provide would be greatly appreciated.

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Nabil Lemsieh

    (@nlemsieh)

    Hi,

    May I know where did you place the [current_slug] shortcode?

    Plugin Author Nabil Lemsieh

    (@nlemsieh)

    If you’re referring the Call to Action URL field, you may add this code snippet to your child theme functions.php to filter shortcodes:

    function filter_shortcodes_in_hurrytimer_cta_url_field($url){
    return do_shortcode($url);
    }
    add_filter('hurryt_cta_url', 'filter_shortcodes_in_hurrytimer_cta_url_field');

    Thread Starter selenaquintanilla

    (@selenaquintanilla)

    Hello Nabil ??,

    I wanted to extend a heartfelt thank you for your swift and effective solution to the shortcode issue I was facing with HurryTimer ( My favorite extension).
    Your suggested filter worked like a charm, and the [current_slug] is now perfectly replacing the page slug in the URL field for the Call to Action. Here’s the code that’s working wonders:

    // Retrieve the current page slug and create a shortcode [current_slug] function get_current_page_slug() { global $post; return $post ? $post->post_name : ''; } add_shortcode('current_slug', 'get_current_page_slug'); // Filter to enable shortcode processing in the HurryTimer CTA URL field function filter_shortcodes_in_hurrytimer_cta_url_field($url){ return do_shortcode($url); } add_filter('hurryt_cta_url', 'filter_shortcodes_in_hurrytimer_cta_url_field');

    This has been incredibly helpful for tracking affiliate links and understanding where clicks are coming from on my site. ??

    By the way, is there an even simpler way to assign a unique identifier to each page to append as a tracking parameter in the URL with your extension?
    I tried with /%postname%/ in the CTA url field but it didn’t work


    I aim to track which pages lead to affiliate purchases now is working i got a “Sub id” with the slug of my page displaying on the affiliation platform but maybe i missed something simplier.

    I use Pretty link and “parameter forwarding” to forward my slug to the merchant/shop.

    Thanks a million! ??

    Plugin Author Nabil Lemsieh

    (@nlemsieh)

    Hi,

    Great to hear that the provided solution has worked for you.

    By the way, is there an even simpler way to assign a unique identifier to each page to append as a tracking parameter in the URL with your extension?

    I’m afraid that HurryTimer doesn’t provide such feature at this time, however, I appreciate your suggestion and will certainly consider it for future updates.

    Plugin Author Nabil Lemsieh

    (@nlemsieh)

    Hi,

    I’m going to mark this thread as resolved, If you have any further questions, feel free to start a new thread.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to use Shortcode in Url field?’ is closed to new replies.