Chassis / puppet-wp

This module enables the easy use of WP CLI to control your WordPress site through Puppet manifests
https://chassis.github.io/puppet-wp/
GNU Lesser General Public License v3.0
44 stars 39 forks source link

Add support for 'wp option patch' to be able to add, update and remove nested values in options too #146

Closed JohnEricson closed 3 years ago

JohnEricson commented 3 years ago

Hi @BronsonQuick! Here is the pull request that adds support for the new wp option patch functionality in WP-CLI that I mentioned in #141. This is a very straight forward modification of your code. I've simply added a new wp::option::patch type that is basically a copy of your wp::option type with some modifications. Here is an example of how it's used:

  wp::option::patch { 'my_array':
    ensure   => 'equal',
    key_path => 'my_key_in_array',
    value    => 'my_new_value',
    location => $wp_install_dir,
  }

I've verified that all operations (present, equal and absent) works fine on both Linux and Windows and I'm already using this to manage my WordPress installations.

I'd really like to have this merged to your repo. If you have any questions or suggestions just let me know 🙂