llback menu or a WP_Error object.
*/
private static function create_default_fallback() {
$default_blocks = static::get_default_fallback_blocks();
// Create a new navigation menu from the fallback blocks.
$default_fallback = wp_insert_post(
array(
'post_content' => $default_blocks,
'post_title' => _x( 'Navigation', 'Title of a Navigation menu' ),
'post_name' => 'navigation',
'post_status' => 'publish',
'post_type' => 'wp_navigation',
),
true // So that we can check whether the result is an error.
);
return $default_fallback;
}
/**
* Gets the rendered markup for the default fallback blocks.
*
* @since 6.3.0
*
* @return string default blocks markup to use a the fallback.
*/
private static function get_default_fallback_blocks() {
$registry = WP_Block_Type_Registry::get_instance();
// If `core/page-list` is not registered then use empty blocks.
return $registry->is_registered( 'core/page-list' ) ? '' : '';
}
}
Fatal error: require_once(): Failed opening required '/home/ocb/public_html/wp-includes/blocks/post-template.php' (include_path='.:/opt/alt/php74/usr/share/pear') in /home/ocb/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 50
Fatal error: Uncaught Error: Call to a member function set() on null in /home/ocb/public_html/wp-includes/l10n.php:856
Stack trace:
#0 /home/ocb/public_html/wp-includes/l10n.php(959): load_textdomain('default', '/home/ocb/publi...', 'lv')
#1 /home/ocb/public_html/wp-includes/class-wp-fatal-error-handler.php(49): load_default_textdomain()
#2 [internal function]: WP_Fatal_Error_Handler->handle()
#3 {main}
thrown in /home/ocb/public_html/wp-includes/l10n.php on line 856