Child Page Parsing By A Plugin Breaks the Parent Page

  • littlegreenviper

    #6701

    Howdy,

    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

    Syahir Hakim

    #35286

    Have you asked the plugin author about this? They would be most familiar about how the plugin parses the content.

    littlegreenviper

    #35287

    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

    Syahir Hakim

    #35288

    Does your plugin get the content by hooking to the_content filter? 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.

    littlegreenviper

    #35289

    Thanks!

    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.

    Mod

    Kenneth John Odle

    #35290

    Marking thread as resolved. You can do this yourself as well.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.