Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins filtering on the_content do not work correctly #156

Open
Sophist-UK opened this issue May 2, 2015 · 5 comments

Comments

@Sophist-UK
Copy link
Contributor

commented May 2, 2015

This plugin applies filters (correctly) on the_content (at lcp-catlist.php line 297), however if these plugins (like simple-tags) want the post-id of the content or check what type of page this is, then they can produce invalid results.

  1. This plugin needs to make get_the_ID work correctly whilst in "the loop" so that content plugins work on the specific post currently processing e.g. in the case of simple_tags to pick up their taxonomy entries;
  2. This plugin effectively converts a single (page or post) into a blog or archive. So whilst in the loop this needs to make the is_feed, is_home, is_singular, is_single, is_page etc. work as expected whilst in "the loop" and then to reset them back again when we ext "the loop". (Again simple-tags checks the type of page when deciding whether to show the tags for the post.)

I am still researching, trying to work out how to save, set and reset these, and then I will need to decide exactly what needs to change whilst in the loop. Any help that people can give would be appreciated.

@Sophist-UK Sophist-UK changed the title Plugins filtering on the_content o not work correctly Plugins filtering on the_content do not work correctly May 2, 2015

@Sophist-UK

This comment has been minimized.

Copy link
Contributor Author

commented May 2, 2015

P.S. There is also an in_the_loop function which needs to produce the correct result.

@Sophist-UK

This comment has been minimized.

Copy link
Contributor Author

commented May 2, 2015

Regarding point 1. above, in lcp-catlist.php at around line 56 we create the query for the catlist loop. However I think we should probably follow the template shown here to save the existing query, create our own query and then restore the original query once catlist has finished.

@Sophist-UK

This comment has been minimized.

Copy link
Contributor Author

commented May 2, 2015

I have tried to make this change, but (so fa at least) it just screws it up. {sigh}

Sophist-UK added a commit to Sophist-UK/wp_List-Category-Posts that referenced this issue May 3, 2015
Fix the loop...
... so that other plugins work as if this was a blog or archive post.
See issue picandocodigo#156.

This commit creates the loop. The is_ functions will need fixing too,
but that will be in a later commit.
@Sophist-UK

This comment has been minimized.

Copy link
Contributor Author

commented May 3, 2015

Fixed by #157.

I decided that setting the conditional tags was probably not possible - just too many different possibilities for the user to choose to be able to know what to set or clear.

@zymeth25

This comment has been minimized.

Copy link
Contributor

commented Feb 8, 2018

Can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.