Skip to content

Commit 4df54f8

Browse files
committed
fixup! Contextual consent
1 parent a2a2c88 commit 4df54f8

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,26 @@ To be a little more user friendly, adding the `data-contextual` attribute will d
387387
</template>
388388
```
389389

390+
<details>
391+
<summary>Integration tips</summary>
392+
393+
#### WordPress
394+
395+
Should you use Orejime in a WordPress website, you could alter the rendering of embeds so they use contextual consent:
396+
397+
```php
398+
function orejimeWrapEmbeds($content, $block) {
399+
if ($block['blockName'] === 'core/embed') {
400+
return '<template data-purpose="medias" data-contextual>' . $content . '</template>';
401+
}
402+
403+
return $content;
404+
}
405+
406+
add_filter('render_block', 'orejimeWrapEmbeds', 10, 2);
407+
```
408+
</details>
409+
390410
## API
391411

392412
Functions and references are made available on the global scope:

0 commit comments

Comments
 (0)