init
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Plan checks for uploading audio files to core/audio.
|
||||
*
|
||||
* @package automattic/jetpack
|
||||
**/
|
||||
|
||||
// Populate the available extensions with core/audio.
|
||||
add_filter(
|
||||
'jetpack_set_available_extensions',
|
||||
function ( $extensions ) {
|
||||
return array_merge(
|
||||
$extensions,
|
||||
array(
|
||||
'core/audio',
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Set the core/audio block availability, depending on the site plan.
|
||||
add_action(
|
||||
'jetpack_register_gutenberg_extensions',
|
||||
function () {
|
||||
\Jetpack_Gutenberg::set_availability_for_plan( 'core/audio' );
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Plan checks for uploading video files to core/cover.
|
||||
*
|
||||
* @package automattic/jetpack
|
||||
**/
|
||||
|
||||
// Populate the available extensions with core/cover.
|
||||
add_filter(
|
||||
'jetpack_set_available_extensions',
|
||||
function ( $extensions ) {
|
||||
return array_merge(
|
||||
$extensions,
|
||||
array(
|
||||
'core/cover',
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Set the core/cover block availability, depending on the site plan.
|
||||
add_action(
|
||||
'jetpack_register_gutenberg_extensions',
|
||||
function () {
|
||||
\Jetpack_Gutenberg::set_availability_for_plan( 'core/cover' );
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Plan checks for uploading video files to core/video.
|
||||
*
|
||||
* @package automattic/jetpack
|
||||
**/
|
||||
|
||||
// Populate the available extensions with core/video.
|
||||
add_filter(
|
||||
'jetpack_set_available_extensions',
|
||||
function ( $extensions ) {
|
||||
return array_merge(
|
||||
$extensions,
|
||||
array(
|
||||
'core/video',
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Set the core/video block availability, depending on the site plan.
|
||||
add_action(
|
||||
'jetpack_register_gutenberg_extensions',
|
||||
function () {
|
||||
\Jetpack_Gutenberg::set_availability_for_plan( 'core/video' );
|
||||
}
|
||||
);
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Plan checks for uploading video files to premium-content/container.
|
||||
*
|
||||
* @package automattic/jetpack
|
||||
**/
|
||||
|
||||
// Populate the available extensions with premium-content/container.
|
||||
add_filter(
|
||||
'jetpack_set_available_extensions',
|
||||
function ( $extensions ) {
|
||||
return array_merge(
|
||||
$extensions,
|
||||
array(
|
||||
'premium-content/container',
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Set the premium-content/container block availability, depending on the site plan.
|
||||
add_action(
|
||||
'jetpack_register_gutenberg_extensions',
|
||||
function () {
|
||||
\Jetpack_Gutenberg::set_availability_for_plan( 'premium-content/container' );
|
||||
}
|
||||
);
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Register VideoPress Video block.
|
||||
*
|
||||
* @package automattic/jetpack
|
||||
**/
|
||||
|
||||
namespace Automattic\Jetpack\Extensions\VideoPress_Video;
|
||||
|
||||
use Automattic\Jetpack\VideoPress\Initializer as VideoPress_Pkg_Initializer;
|
||||
|
||||
// Set the videopress/video block availability, depending on the site plan.
|
||||
add_action(
|
||||
'jetpack_register_gutenberg_extensions',
|
||||
function () {
|
||||
\Jetpack_Gutenberg::set_availability_for_plan( 'videopress/video' );
|
||||
}
|
||||
);
|
||||
|
||||
// Register the videopress/video block.
|
||||
add_action(
|
||||
'init',
|
||||
function () {
|
||||
$extensions = \Jetpack_Gutenberg::get_extensions();
|
||||
$is_videopress_video_extension_enabled = in_array( 'videopress/video', $extensions, true );
|
||||
|
||||
if (
|
||||
$is_videopress_video_extension_enabled &&
|
||||
method_exists( 'Automattic\Jetpack\VideoPress\Initializer', 'register_videopress_video_block' )
|
||||
) {
|
||||
VideoPress_Pkg_Initializer::register_videopress_video_block();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Register the `v6-video-frame-poster` extension.
|
||||
add_action(
|
||||
'jetpack_register_gutenberg_extensions',
|
||||
function () {
|
||||
\Jetpack_Gutenberg::set_extension_available( 'v6-video-frame-poster' );
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user