Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 19 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | /** |
| 3 | * Plan checks for uploading audio files to core/audio. |
| 4 | * |
| 5 | * @package automattic/jetpack |
| 6 | **/ |
| 7 | |
| 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | exit( 0 ); |
| 10 | } |
| 11 | |
| 12 | // Populate the available extensions with core/audio. |
| 13 | add_filter( |
| 14 | 'jetpack_set_available_extensions', |
| 15 | function ( $extensions ) { |
| 16 | return array_merge( |
| 17 | (array) $extensions, |
| 18 | array( |
| 19 | 'core/audio', |
| 20 | ) |
| 21 | ); |
| 22 | } |
| 23 | ); |
| 24 | |
| 25 | // Set the core/audio 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/audio' ); |
| 30 | } |
| 31 | ); |