Implement network-specific metadata handling in commands.#518
Implement network-specific metadata handling in commands.#518spacedmonkey wants to merge 1 commit intowp-cli:mainfrom
Conversation
Added overrides for add, update, get, and delete metadata methods to utilize network-specific options when available. This ensures compatibility and functionality for multisite network scenarios. Fallbacks to standard metadata functions are maintained for non-network environments.
|
Pinging maintainers to get eyes on this @swissspidy @danielbachhuber @schlessera |
This comment was marked as resolved.
This comment was marked as resolved.
|
Two thoughts:
|
No one was assigned for a code reviewers. Maybe this repo needs a codeowner file 🤔
Before spending any time on getting tests to work, I wanted to make sure everyone was happy with the approach.
The core patch is not confirmed yet and not work. Also that will only fix the issue with 6.8+. WP CLI support down to 3.7. Fixing this here is to ensure BC. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
Yes, approach looks good, @jonnynews. If we add the tests from #504 , this will be good to go. |
|
According to the issue description, the following test should reproduce the situation: Scenario: Network meta is actually network options
Given a WP multisite install
When I run `wp eval 'update_network_option( 1, "mykey", "123" );'`
And I run `wp eval 'echo get_network_option( 1, "mykey" );'`
Then STDOUT should be:
"""
123
"""
When I run `wp network meta update 1 mykey 456`
Then STDOUT should be:
"""
Success: Updated custom field 'mykey'.
"""
When I run `wp network meta get 1 mykey`
Then STDOUT should be:
"""
456
"""
When I run `wp eval 'echo get_network_option( 1, "mykey" );'`
Then STDOUT should be:
"""
456
"""Is that accurate? Because this currently passes for me on |
Added overrides for add, update, get, and delete metadata methods to utilize network-specific options when available. This ensures compatibility and functionality for multisite network scenarios. Fallbacks to standard metadata functions are maintained for non-network environments.
Add function exists, to ensure compatablity with 4.2 below.
Fixes #504