← All changes
|
extensions/extended-blocks/core-video/core-video.php
+31
-0
16.2-beta
→
16.3-a.7
View file →
| @@ -1,0 +1,31 @@ | ||
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Plan checks for uploading video files to core/video. | |
| 4 | + * | |
| 5 | + * @package automattic/jetpack | |
| 6 | + **/ | |
| 7 | + | |
| 8 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 9 | + exit( 0 ); | |
| 10 | +} | |
| 11 | + | |
| 12 | +// Populate the available extensions with core/video. | |
| 13 | +add_filter( | |
| 14 | + 'jetpack_set_available_extensions', | |
| 15 | + function ( $extensions ) { | |
| 16 | + return array_merge( | |
| 17 | + (array) $extensions, | |
| 18 | + array( | |
| 19 | + 'core/video', | |
| 20 | + ) | |
| 21 | + ); | |
| 22 | + } | |
| 23 | +); | |
| 24 | + | |
| 25 | +// Set the core/video block availability, depending on the site plan. | |
| 26 | +add_action( | |
| 27 | + 'jetpack_register_gutenberg_extensions', | |
| 28 | + function () { | |
| 29 | + \Jetpack_Gutenberg::set_availability_for_plan( 'core/video' ); | |
| 30 | + } | |
| 31 | +); | |