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

wp_json_encode should use relevant filters #117

Open
kadamwhite opened this issue Sep 4, 2017 · 1 comment
Open

wp_json_encode should use relevant filters #117

kadamwhite opened this issue Sep 4, 2017 · 1 comment

Comments

@kadamwhite
Copy link

Specifically, I feel that the title value should be run through the document_title_parts filter, so that any processing which happens to the title attribute as rendered by WordPress can be applied to the JSON-encoded value as well. There may be other areas where a traditional theme would apply a filter to content which Foxhound exposes to JS; maintaining parity in these situations is generally useful.

@ryelle
Copy link
Owner

ryelle commented Nov 29, 2017

You're talking about the site title set here, right? I don't think document_title_parts really applies here– that's meant to be run over the entire title in parts, but this is just the site title part. The <title> itself if built in each component. As it is, you could use the bloginfo filter to adjust this.

What were you trying to do, that you couldn't do?

maintaining parity in these situations is generally useful.

Overall I agree with you, but most of the data Foxhound uses comes from the API directly, and the relevant filters should be applied already – was there anywhere else you found that not the case?

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

No branches or pull requests

2 participants