• Resolved Twig

    (@twiginteractive)


    Hi – I want to have WPEL process post content for external links from within a REST call, but currently it seems that the plugin (although active during the REST call) is not applying the external logic, even if $post_content=apply_filters('the_content', $raw_content); is called – where $raw_content is the raw post content retrieved via a public REST call.

    Is there a way to have WPEL treat this content as if it were within the Loop on a page?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Alexandru Tapuleasa

    (@talextech)

    Hi,

    In External Links Settings -> Exceptions uncheck All Content for the Apply To option and just leave the sub-checkboxes checked 🙂

    Thread Starter Twig

    (@twiginteractive)

    @talextech
    Thank you for this info – that seems to work! It’s a bit of a strange UX though, I would have thought having all sub-checkboxes checked would have the same effect as the parent being checked… and there’s no dox on why this would affect REST calls… but it works 😀

    So there isn’t an exposed public method for this, like calling \WPEL_Link->scan() or something, even in the Pro version? Just curious for future use…

    Thanks for all your hard work on this plugin!

    —-

    UPDATE: actually this approach doesn’t work as expected. By unchecking the parent box, other Blocks in included the page template are not getting processed. ☹

    Is there a programmatic method we can use?

    • This reply was modified 8 months, 1 week ago by Twig.
    Plugin Author Alexandru Tapuleasa

    (@talextech)

    Hi,

    If All Contents is checked then we output buffer the whole content and just parse it at the end but it can mess things up in some cases like REST API and we have not found a proper fix for that.

    If you uncheck that then we just use WordPress hooks like the_content to parse only that. But we don’t have a public method that you can call externally, sorry 🙁

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

The topic ‘Trigger the link processing programmatically in PHP for REST calls’ is closed to new replies.