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

Closed
Sophist-UK opened this issue May 2, 2015 · 6 comments
Closed

Plugins filtering on the_content do not work correctly #156

Sophist-UK opened this issue May 2, 2015 · 6 comments
Labels

Comments

@Sophist-UK
Copy link
Contributor

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
Copy link
Contributor Author

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

@Sophist-UK
Copy link
Contributor Author

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
Copy link
Contributor Author

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
... 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
Copy link
Contributor Author

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.

@klemens-st
Copy link
Collaborator

Can be closed.

@stale
Copy link

stale bot commented Jun 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants