Child Page Parsing By A Plugin Breaks the Parent Page
I have a problem.
I had child pages listing, but I have a plugin that parses content, and does some stuff within the content if certain shortcodes/whatnot are there.
The problem is that the child pages seem to be completely valid full pages to this content filter, so the entire page breaks if the child pages are enabled.
Disabling child pages is not the optimal solution, but it is what I had to do.
Is there a way to convince the plugin that the child page should not be parsed?Admin
I am the plugin author.
The plugin gets the content in exactly the same manner as in a full page.
I’m looking for a flag in which I can tell my parser to leave the content alone.
In archive pages, I know these are not full pages, but your child page listings seem to follow a different path.
I’m quite willing to look for cues and handle it myself; I just don’t know what the cues are.Admin
Does your plugin get the content by hooking to
the_contentfilter? If so you may be able to use the is_main_query() function to detect if the content it’s getting is from the main query or from other secondary queries on the page. The child page listing in this case would not be a main query.
Well, it’s fixed. There were two issues:
1) I should have used is_singular().
2) I had a nested function (function inside a function) that gave Graphene the heebie-jeebies. I have no idea why. In any case, it wasn’t difficult to move the function out into the global context, and that fixed it.
Really thrilled with Graphene. You guys done good.
You must be logged in to reply to this topic.