Commit c6805fb
authored
Sharing: only hook block to single post template on WP 6.5+ (#35905)
Follow-up to #35542
Core recently changed the definition of the filter we're using to automatically add the sharing block to post templates. As a result, our code is not compatible with WordPress 6.4 anymore:
```
PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function Automattic\Jetpack\Extensions\Sharing_Button_Block\add_default_services_to_block(), 4 passed in /var/www/html/wp-includes/class-wp-hook.php on line 324 and exactly 5 expected in /usr/local/src/jetpack-monorepo/projects/plugins/jetpack/extensions/blocks/sharing-button/sharing-button.php:254
```
Let's gate that functionality to WordPress 6.5+ to avoid that error.1 parent c8b3b5b commit c6805fb
File tree
2 files changed
+15
-2
lines changed- projects/plugins/jetpack
- changelog
- extensions/blocks/sharing-button
2 files changed
+15
-2
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
33 | 44 | | |
34 | 45 | | |
35 | 46 | | |
| |||
236 | 247 | | |
237 | 248 | | |
238 | 249 | | |
239 | | - | |
240 | 250 | | |
241 | 251 | | |
242 | 252 | | |
| |||
312 | 322 | | |
313 | 323 | | |
314 | 324 | | |
315 | | - | |
| |||
0 commit comments