snippet-library icon indicating copy to clipboard operation
snippet-library copied to clipboard

`gw-update-posts.php`: Added support for specifying an `append` parameter for meta values.

Open spivurno opened this issue 1 year ago • 1 comments
trafficstars

When set, snippet will append images for ACF Gallery fields instead of replacing. This is currently limited to ACF Gallery fields but could be readily expanded to other field types.

Context

⛑️ Ticket(s): https://secure.helpscout.net/conversation/2476493794/59790

Summary

Customer is using our Update Posts snippet to update an ACF gallery field attached to a post. Instead of replacing the images, he wants to append them.

This PR introduces the concept of passing custom parameters per meta value. Instead of setting the key and value, like so:

'my_gallery' => 3

...you would instead pass an array as the value with any desired parameters:

'my_gallery' => array(
    'field_id' => 3,
    'append' => true,
)

The previous format still works, of course.

spivurno avatar Feb 05 '24 22:02 spivurno

Fails
:no_entry_sign: Pull request title needs to end in a period or exclamation.
:no_entry_sign:

Commit message '~ Bumped the version: 0.6' does match the correct format. See our Snippet Library Commit Messages Guidelines in Notion.

:no_entry_sign:

Commit message '~ Bumped the version: 0.6' needs to end in a period or exclamation.

Generated by :no_entry_sign: dangerJS against f39aeddec1a8e1954aa0047c603cc8f6b3605e4c

github-actions[bot] avatar Feb 05 '24 22:02 github-actions[bot]