• Resolved wtframework

    (@wtframework)


    I am just wondering what I can do with regards to the WordPress rest API and pulling URLs from there?
    I have images that will still pull in the full url and not the CDN url. Is there a way to pass through a filter to update to KeyCDN urls?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m assuming your image links are hard-coded directly in your JSON file? Currently, CDN Enabler is unable to replace those types of links. However, I’ll make note of this with the dev team.

    Thread Starter wtframework

    (@wtframework)

    Is there any way to do this currently? I was thinking of having the theme check for you plugin and use the filter you use but not on template_redirect. Im happy to create a solution for myself to get it working then integrate it into the plugin (no charge of course!)

    Thread Starter wtframework

    (@wtframework)

    sorry I realise I did not answer your question, it is a front end SPA, I pull all the urls from wordpress using:

    add_action( ‘rest_api_init’, function () {
    register_rest_route( ‘myplugin/v1’, ‘/author/(?P<id>\d+)’, array(
    ‘methods’ => ‘GET’,
    ‘callback’ => ‘my_awesome_func’,
    ) );
    } );

    (thats example above not actual code)

    There currently isn’t a way to achieve this however you can certainly open a pull request on GitHub if you achieve a solution and would like to contribute. https://github.com/keycdn/cdn-enabler

    • This reply was modified 8 years, 6 months ago by codyarsenault.
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘REST API urls’ is closed to new replies.