Skip to content

Commit

Permalink
fixup! Contextual consent
Browse files Browse the repository at this point in the history
  • Loading branch information
felixgirault committed Feb 11, 2025
1 parent a2a2c88 commit 4df54f8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,26 @@ To be a little more user friendly, adding the `data-contextual` attribute will d
</template>
```

<details>
<summary>Integration tips</summary>

#### WordPress

Should you use Orejime in a WordPress website, you could alter the rendering of embeds so they use contextual consent:

```php
function orejimeWrapEmbeds($content, $block) {
if ($block['blockName'] === 'core/embed') {
return '<template data-purpose="medias" data-contextual>' . $content . '</template>';
}

return $content;
}

add_filter('render_block', 'orejimeWrapEmbeds', 10, 2);
```
</details>

## API

Functions and references are made available on the global scope:
Expand Down

0 comments on commit 4df54f8

Please sign in to comment.