ryelle / Foxhound

A text-focused blog theme for WordPress (in React)
https://themes.redradar.net/foxhound
350 stars 39 forks source link

wp_json_encode should use relevant filters #117

Open kadamwhite opened 7 years ago

kadamwhite commented 7 years ago

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 commented 6 years ago

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?