Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Remove Shortcodes from response #2962

Closed
MarcoMeloni opened this issue Dec 11, 2016 · 5 comments
Closed

Remove Shortcodes from response #2962

MarcoMeloni opened this issue Dec 11, 2016 · 5 comments

Comments

@MarcoMeloni
Copy link

I use the theme DIVI from ElegantTheme and I need to remove all ET shortcodes from the response of WP REST api.
Someone has already solved this problem?

Thanks

@modemlooper
Copy link

Read this post on modifying response http://boris.kuzmanov.ninja/wp-rest-api-modifying-json-response/

Then run content in Json through https://codex.wordpress.org/Function_Reference/strip_shortcodes

@rmccue rmccue closed this as completed Jan 4, 2017
@preeteshjain
Copy link

@MarcoMeloni Did you solve this problem?

@MarcoMeloni
Copy link
Author

@preeteshjain
No, I have temporarily abandoned the project because I am following one another.

@preeteshjain
Copy link

preeteshjain commented May 9, 2017

@MarcoMeloni Okay. After commenting here, I worked on a possible workaround. This works for me:

// Removes Divi shortcodes
$content = preg_replace('/\[\/?et_pb.*?\]/', '', $content);

Hope this helps anyone who drops here looking for help after Googling, like I did.

@MarcoMeloni
Copy link
Author

@preeteshjain Thank you, I will keep it in mind when I need it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants