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

MultiSite - Scoping Dismissal to Blog or Site #37

Open
woodwardmatt opened this issue Feb 16, 2021 · 3 comments
Open

MultiSite - Scoping Dismissal to Blog or Site #37

woodwardmatt opened this issue Feb 16, 2021 · 3 comments

Comments

@woodwardmatt
Copy link

woodwardmatt commented Feb 16, 2021

Hey guys, just checking out your plugin for persistent, dismissable admin notices. I spotted that your using "get_site_option" and "update_site_option" which will indeed cover both standalone and multisite implementation of WordPress. However, if on a Multisite install you want to scope the dismissal to each blog, not the site as a whole using those functions will prevent that use case.

Was thinking maybe an additional argument / option for scope e.g. "site" / "blog" which could be used to conditionally call the required option functions. (Noting that this would also require extending the jquery routine to pop the scope also.)

Any appetite for that change?

@woodwardmatt woodwardmatt changed the title MultiSite - Scoping Dismissal to User or Site MultiSite - Scoping Dismissal to Blog or Site Feb 16, 2021
@woodwardmatt
Copy link
Author

Note: I've temporarily hard-coded to use the "get_option" and "update_option" - ideally this would be configurable based on scope to avoid issues when updating etc.

@w3guy
Copy link
Owner

w3guy commented Feb 24, 2021

Nice idea. Feel free to submit a PR

@Surbma
Copy link
Contributor

Surbma commented Mar 13, 2021

+1 for this feature.

I have Multisite installs, that have very different websites, where it makes no sense to dismiss the notifications globally.

I suggest to go back to get_option and update_option by default and we can add a new attribute next to data-dismissible, like data-dismissible-network, which could have the "yes" or "global" value. If this attribute is defined, only than should we use the get_site_option and update_site_option functions.

Example code:
<div data-dismissible="disable-done-notice-forever" data-dismissible-network="global" class="updated notice notice-success is-dismissible">

If this solutions is something you like, I can make a PR with this modification. Let me know!

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

3 participants