Skip to content

Commit

Permalink
Update api-reference.md (#59955)
Browse files Browse the repository at this point in the history
The examples have an error. 

data-bind--hidden should be data-wp-bind--hidden

Unlinked contributors: tomepajk.

Co-authored-by: t-hamano <wildworks@git.wordpress.org>
  • Loading branch information
tomepajk and t-hamano committed Mar 20, 2024
1 parent f653ff4 commit 4bb17c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/interactivity/docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Interactivity API directives use the `data-` prefix. Here's an example of direct
Toggle
</button>

<p id="p-1" data-bind--hidden="!context.isOpen">
<p id="p-1" data-wp-bind--hidden="!context.isOpen">
This element is now visible!
</p>
</div>
Expand Down Expand Up @@ -652,10 +652,10 @@ const { state } = store( "myPlugin", {
} );
```

And then, the string value `"state.isPlaying"` is used to assign the result of this selector to `data-bind--hidden`.
And then, the string value `"state.isPlaying"` is used to assign the result of this selector to `data-wp-bind--hidden`.

```html
<div data-bind--hidden="!state.isPlaying" ... >
<div data-wp-bind--hidden="!state.isPlaying" ... >
<iframe ...></iframe>
</div>
```
Expand All @@ -668,7 +668,7 @@ The example below is getting `state.isPlaying` from `otherPlugin` instead of `my

```html
<div data-wp-interactive="myPlugin">
<div data-bind--hidden="otherPlugin::!state.isPlaying" ... >
<div data-wp-bind--hidden="otherPlugin::!state.isPlaying" ... >
<iframe ...></iframe>
</div>
</div>
Expand Down

0 comments on commit 4bb17c4

Please sign in to comment.