• Resolved mdxclr

    (@mdxclr)


    Hi,
    I want to make some part of content dynamic, using do_shortcode (for replacing currency and change amount based on rates). Tried rest_pre_echo_response with priority 10 and 9999 (looks like plugin in get_api_cache using 1000 priority), but still getting shortcode in a raw.

    Or maybe there is better solution how to do this?
    I’m sending currency as header, list of currencies and rates provided in php files.

    • This topic was modified 2 years, 3 months ago by mdxclr.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter mdxclr

    (@mdxclr)

    Okay, as I understand this filter is skipped and content is returned from get_cache function – is there a way how can I filter its content?

    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @mdxclr

    If a cache record is present for the current request, it is returned and none of the filters you mentioned are triggered. At this point there isn’t a filter available to filter the cached data, however I think I do understand your use case. I think we can add a filter you could use, however I will have to discuss this with my colleagues first. I will see if we can add such a filter next week and will get back to you!

    By the way: because of the way our plugin works (if a cache is present no (normal) plugins are executed) you would have to use this filter from a mu-plugin which is alphabetically before wp-rest-cache.php

    Thread Starter mdxclr

    (@mdxclr)

    That would be great, if you can add the filter, because filtering it throw get_transient_* is very hard.

    Plugin Author Richard Korthuis

    (@rockfire)

    @mdxclr We just released a new version of our plugin which includes a new filter wp_rest_cache/filter_cache_output which can be used from a must use plugin that is loaded before our must use plugin (so alphabetically before wp-rest-cache.php).

    Thread Starter mdxclr

    (@mdxclr)

    Can you also please add to filter some data about request? Request URI or callback function name for example

    Plugin Author Richard Korthuis

    (@rockfire)

    @mdxclr Isn’t the Request URI something you can get from $_SERVER['REQUEST_URI']? What would it add if we added it to the filter?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘trigger do_shortcode on cached request’ is closed to new replies.