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

Bug: parameters handling in CatListDisplayer::get_post_title #350

Closed
klemens-st opened this issue Oct 11, 2018 · 4 comments · Fixed by #417
Closed

Bug: parameters handling in CatListDisplayer::get_post_title #350

klemens-st opened this issue Oct 11, 2018 · 4 comments · Fixed by #417

Comments

@klemens-st
Copy link
Collaborator

https://wordpress.org/support/topic/get_post_title-has-to-be-improved/

@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
@klemens-st
Copy link
Collaborator Author

There are more bugs in this method, I'm afraid I'm gonna have to rewrite it from scratch 😒

@picandocodigo
Copy link
Owner

Oh, I can look into this tomorrow too. Is it the bug that's being reported there or did you find more issues?

@klemens-st
Copy link
Collaborator Author

In #288 I didn't refactor get_post_title and get_post_link because they don't fit the pattern of almost all other methods. This is caused by the exception described in the docs. I only replaced the call to assign_style with wrapper->wrap but this didn't change anything.

The problem is it doesn't really work as described in the docs. One thing is the bug reported in this issue. Another thing is how shortcode parameters and method call arguments are handled.

  • if we don't pass any $tag or $css_class to get_post_title and only use shortcode paramters title_tag, title_class then the tags and classes are handled as per the docs.
  • if we use both function arguments and shortcode parameters it will first handle shortcode parameters and then wrap all of that with the $tag and $class passed as arguments.

This is because shortcode parameters and function arguments are handled separately in this method, whereas they should be handled togetether following the rule that shortcode parameters take precedence over arguments. Right now lines 228-254 deal with shortcode params and then lines 256-258 handle arguments, completely separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants