I have a plugin that fetches post content, then runs it through a series of custom and native the_content filters and updates the post using ajax. Problem is that I have many other filters also running so they get all garbled up, and the filters I need to run are just left in the dust. Instead of manually setting all the priorities and adding/removing in all the right places, is there a way to write a neat little function to get the plugins talking in terms of the_content filters before ajax wp_update_post?

Something like "Hey, before you fetch the content and/or update the post, check this other plugin's filters first. BTW, its filters are more important than yours. Oh, and forget all your remove/add filter nonsense too. Well, not completely. We still need you to do your thing, just don't override the other one. Thanks, in advance."

Sorry if it's a dumb question. Just seems like there should be a simple solution.

  • 2
    You're updating posts with the value returned from the_content filter? That sounds very wrong.
    – Milo
    Aug 6 '18 at 1:50
  • The question is not dumb at all, but as Milo implies it sounds like there is something very wrong being done. In general the order of execution of filters should not matter and if it does it means that one of the filters is not written well. Aug 6 '18 at 5:48
  • Hi, it's from a code canyon plugin that allows the user to edit the posts on the front-end. They're using the_content instead of get_the_content supposedly so they can wrap the post in a targeted div. It's a one-of-a-kind plugin and one that I really need to work. I was very disappointed to find out it was changing other areas of my posts that it should not be changing :/
    – SHA3.org
    Aug 6 '18 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.