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

[dev] All terms get saved instead of just selected terms #53

Closed
leymannx opened this issue Apr 10, 2019 · 8 comments
Closed

[dev] All terms get saved instead of just selected terms #53

leymannx opened this issue Apr 10, 2019 · 8 comments

Comments

@leymannx
Copy link
Contributor

I checked out the dev branch for WP5 compatibility and radios appear nicely for the chosen taxonomies.

Unfortunately the term saving doesn't seem to work properly. After I selected a term, saved the post and watched it in the frontend, all terms appear.

I'd expect only the chosen term to be applied.

That's what I selected

Screenshot 2019-04-10 10 56 20

That's what has been saved

Screenshot 2019-04-10 10 56 35

@helgatheviking
Copy link
Owner

Great, I was going to open this based on your WP.org reply. And just noticed it myself. I think I have to dig into the API as everything in Gutenberg is saved via the API.

@helgatheviking
Copy link
Owner

helgatheviking commented Apr 10, 2019

Either need to find a way to modify the results of WP_REST_Posts_Controller or perhaps extend the class and replace the controller for all radio taxonomies via the register_taxonomy_args filter.

@helgatheviking
Copy link
Owner

I actually think this may be more oriented towards the JS side of things. Specifically, may need to mimic how the Radio controls set state. https://github.com/WordPress/gutenberg/tree/master/packages/components/src/radio-control

@helgatheviking
Copy link
Owner

@leymannx Hi Norman. I just pushed a few changes. I think it solves the saving issue. I'd appreciate it if you could take a look when you have a chance.

@leymannx
Copy link
Contributor Author

It works super smooth now. Select and updates precisely. Well done!

Only one minor thing with the styles of the focused radio that underlaps the meta box wrapper. It's not bad thing, but it may look broken to the enduser. I'll drop a new issue for that.

@helgatheviking
Copy link
Owner

I've seen the style thing too. Not sure what to do about it.

Glad it's working! Gotta give credit to @5ally and her work at https://github.com/5ally/my-term-selector/ she's been amazingly helpful on this.

I am a little nervous about just how many changes were made to the term selector script. I fear it coud be hard to maintain, but we'll cross that bridge when we get to it.

I'll give a quick thought to the style issue and try to get this packaged up for release!

@leymannx
Copy link
Contributor Author

I'm a little bit concerned regarding backwards compatibility. But you didn't remove any of the old code? So the plugin should still work on older WordPress versions you think?

@helgatheviking
Copy link
Owner

helgatheviking commented Apr 24, 2019 via email

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