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

Add shortcuts for get, and update in options loader #1

Open
alexstandiford opened this issue Jun 3, 2020 · 1 comment
Open

Add shortcuts for get, and update in options loader #1

alexstandiford opened this issue Jun 3, 2020 · 1 comment

Comments

@alexstandiford
Copy link
Contributor

Currently the only way to update an option is:
underpin()->options()->get( 'option_key' )->update( $value );

Which is a bit long-winded.

It would be nice if this were possible:

underpin()->options()->update('option_key',$value);

@alexstandiford
Copy link
Contributor Author

underpin()->options()->pluck() has been added, which is a shortcut for the pluck method.

underpin()->options()->update() has also been updated to allow both $key and $value to automatically set array-syntax items.

The problem here is the R in the CRUD at this level gets a little confusing, because you'd want to use option()->get() as a wrapper for get_option however, get() is used to get the registry item.

@alexstandiford alexstandiford transferred this issue from Underpin-WP/underpin-plugin-boilerplate Oct 25, 2021
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

1 participant