-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Persist user's editor preferences to database rather than local storage #15105
Comments
There may need to be some additional consideration here for how preferences persist across sites in a network of sites (multisite). The current
Relevant Slack conversation (link requires registration): https://wordpress.slack.com/archives/C02QB2JS7/p1553102329709300 |
The |
Adding my vote to make it easier to turn off tips per user instead of per site! Also noting another case where a "sticky" setting was requested for images to keep their size setting once set (and until it's changed again) in #8663. |
In #15800, I explore a relatively simple implementation which leverages the user settings cookie, existing |
Separately, I was exploring what options might exist for syncing settings to and from the REST API. |
A revision to the original proposal: The https://github.com/WordPress/gutenberg/tree/master/packages/data/src/plugins/persistence#storage It defaults to |
Hi @aduth, |
@jorgefilipecosta While I don't know that I considered it too closely, I think it's fair to say that (as you mention) we don't really need the localStorage data storage if we persist to a settings endpoint, especially if the data is made available immediately upon page load (using preloaded/bootstrapped endpoint data, which we already support). To clarify however, the |
An alternative implementation using the REST API users endpoint |
Renaming this issue as it seems folks have a hard time finding it. Closing #28971 as a duplicate. |
I'm interested in this thread because I'm having severe issues with Wordpress, like I can't add new users, and changes of admin (block)settings are not saved. Thank you, P.s. see my post at |
@yolinfl This proposal won't solve your problem with adding users. It will help save your block manager options more permanently. At the moment if you clear your browser storage they'll be lost. |
Hi Talldan, |
Oh, I thought I just mentioned that 😄 . At the moment editor preferences are saved in your browser local storage, so you have to not clear your browser local storage. I'm not sure if the browser you're using does this automatically, it might be that you have your security settings at the highest level and this happens as a result. For an actual solution, I don't know that there is one, it might be worth looking at what plugins provide. In the longer term there is work happening to solve the problem, work has recently commenced again on the change to save preferences to the database - #19177. I imagine the hope is for this to be in WordPress 5.9 and sooner in the Gutenberg plugin. |
Thanks Talidan! |
As reported on Trac 55253:
|
Three years and this still hasn't been fixed |
This is now being worked on in #39795. It won't make WordPress 6.0, but I'll try to land something for 6.1. |
Thanks for the update @talldan. Good to hear it's making some progress. |
Related: #14512
The data module includes a
persistence
plugin which can be used by data stores to persist state values to browser storage.https://github.com/WordPress/gutenberg/tree/master/packages/data/src/plugins/persistence
In the block editor, this is used in a few stores to persist preferences (e.g. toolbar placement, "new user experience" tips, etc).
Due to the transient nature of browser storage, this persistence is not as sticky as it is expected to be, including: switching browsers (unique storage between browsers), or using private browsing tabs (storage cleared between sessions), or the same user across a network of sites (storage unique by domain).
Proposal:
Preferences should be persisted as user meta. Given the WordPress-agnostic nature of the
@wordpress/data
module, this should be implemented in such a way that another environment could substitute their own (assumed asynchronous) persistence mechanism.Specific details:
Add a new option(Edit: This should not be necessary, see Persist user's editor preferences to database rather than local storage #15105 (comment))onChange
to the plugin interfaceonChange
should communicate with the users REST endpoint, updating using themeta
fieldshow_in_rest
)The text was updated successfully, but these errors were encountered: