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

Nested Array for Pluck Option Examples? #106

Closed
wpbullet opened this issue Oct 30, 2017 · 2 comments
Closed

Nested Array for Pluck Option Examples? #106

wpbullet opened this issue Oct 30, 2017 · 2 comments

Comments

@wpbullet
Copy link

wpbullet commented Oct 30, 2017

I am loving pluck and patch!

According to the docs it looks like it should be possible to access multiple values

Here is my example

wp option get wp_bullet_lazy_load_filters_tab
I get this output

array (
  'disable_first_image_post' => '1',
  'll_skipped_pages_list' =>
  array (
    0 => '/fixing-wp_options-table-missing-unique-column-primary-key/',
  ),
  'll_style_classes_option' => '1',
  'll_style_classes_list' =>
  array (
    0 => 'textwidget',
  ),
  'built_in_classes' => 'none',
)

Then plucking

wp option pluck wp_bullet_lazy_load_filters_tab ll_style_classes_list

array (
  0 => 'textwidget',
)

How can I access this array's values? I've tried variations of this to no avail

wp option pluck wp_bullet_lazy_load_filters_tab ll_style_classes_list,0
wp option pluck wp_bullet_lazy_load_filters_tab ll_style_classes_list[0]

I figured it out!

wp option pluck wp_bullet_lazy_load_filters_tab ll_style_classes_list 0 outputs

textwidget
@danielbachhuber
Copy link
Member

Hi @wpbullet,

Please use Slack for support questions, thanks.

@wpbullet
Copy link
Author

In case anybody finds this via Google, I have documented this in more detail here https://guides.wp-bullet.com/using-wp-cli-to-batch-update-serialized-wp_options-settings/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants