This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WP_Compat::define_polyfills()
Polyfills that can not be defined elsewhere go here.
Description
that may not work properly.
Return
(void)
Source
File: wp-includes/classicpress/class-wp-compat.php
private function define_polyfills() {
// Polyfills that must not have to be defined elsewhere go there.
if ( ! function_exists( 'register_block_type' ) ) {
/**
* Polyfill for block functions.
*
* @since CP-2.0.0
*
* @return bool False.
*/
function register_block_type( ...$args ) {
WP_Compat::using_block_function();
return false;
}
}
if ( ! function_exists( 'unregister_block_type' ) ) {
/**
* Polyfill for block functions.
*
* @since CP-2.0.0
*
* @return bool False.
*/
function unregister_block_type( ...$args ) {
WP_Compat::using_block_function();
return false;
}
}
if ( ! function_exists( 'register_block_type_from_metadata' ) ) {
/**
* Polyfill for block functions.
*
* @since CP-2.0.0
*
* @return bool False.
*/
function register_block_type_from_metadata( ...$args ) {
WP_Compat::using_block_function();
return false;
}
}
if ( ! function_exists( 'has_block' ) ) {
/**
* Polyfill for block functions.
*
* @since CP-2.0.0
*
* @return bool False.
*/
function has_block( ...$args ) {
WP_Compat::using_block_function();
return false;
}
}
if ( ! function_exists( 'has_blocks' ) ) {
/**
* Polyfill for block functions.
*
* @since CP-2.0.0
*
* @return bool False.
*/
function has_blocks( ...$args ) {
WP_Compat::using_block_function();
return false;
}
}
if ( ! function_exists( 'register_block_pattern' ) ) {
/**
* Polyfill for block functions.
*
* @since CP-2.0.0
*
* @return bool False.
*/
function register_block_pattern( ...$args ) {
WP_Compat::using_block_function();
return false;
}
}
if ( ! function_exists( 'unregister_block_pattern' ) ) {
/**
* Polyfill for block functions.
*
* @since CP-2.0.0
*
* @return bool False.
*/
function unregister_block_pattern( ...$args ) {
WP_Compat::using_block_function();
return false;
}
}
if ( ! function_exists( 'register_block_pattern_category' ) ) {
/**
* Polyfill for block functions.
*
* @since CP-2.0.0
*
* @return bool False.
*/
function register_block_pattern_category( ...$args ) {
WP_Compat::using_block_function();
return false;
}
}
if ( ! function_exists( 'unregister_block_pattern_category' ) ) {
/**
* Polyfill for block functions.
*
* @since CP-2.0.0
*
* @return bool False.
*/
function unregister_block_pattern_category( ...$args ) {
WP_Compat::using_block_function();
return false;
}
}
if ( ! function_exists( 'wp_is_block_theme' ) ) {
/**
* Polyfill for block functions.
*
* @since CP-2.0.0
*
* @return bool False.
*/
function wp_is_block_theme( ...$args ) {
WP_Compat::using_block_function();
return false;
}
}
if ( ! function_exists( 'parse_blocks' ) ) {
/**
* Polyfill for block functions.
*
* @since CP-2.2.0
*
* @return array array().
*/
function parse_blocks( ...$args ) {
WP_Compat::using_block_function();
return array();
}
}
if ( ! function_exists( 'get_dynamic_block_names' ) ) {
/**
* Polyfill for block functions.
*
* @since CP-2.2.0
*
* @return string ''.
*/
function get_dynamic_block_names( ...$args ) {
WP_Compat::using_block_function();
return '';
}
}
if ( ! function_exists( 'get_block_theme_folders' ) ) {
/**
* Polyfill for block functions.
*
* @since CP-2.3.0
*
* @return string ''.
*/
function get_block_theme_folders( ...$args ) {
WP_Compat::using_block_function();
return '';
}
}
// Load WP_Block_Type class file as polyfill.
require_once ABSPATH . WPINC . '/classicpress/class-wp-block-type.php';
require_once ABSPATH . WPINC . '/classicpress/class-wp-block-template.php';
}