enberg_initialize_editor( 'edit_site_editor', 'edit-site', array( 'preload_paths' => array_merge( array( array( '/wp/v2/media', 'OPTIONS' ), '/wp/v2/types?context=view', '/wp/v2/types/wp_template?context=edit', '/wp/v2/types/wp_template-part?context=edit', '/wp/v2/taxonomies?context=view', '/wp/v2/pages?context=edit', '/wp/v2/categories?context=edit', '/wp/v2/posts?context=edit', '/wp/v2/tags?context=edit', '/wp/v2/templates?context=edit&per_page=-1', '/wp/v2/template-parts?context=edit&per_page=-1', '/wp/v2/settings', '/wp/v2/themes?context=edit&status=active', '/wp/v2/global-styles/' . $active_global_styles_id . '?context=edit', '/wp/v2/global-styles/' . $active_global_styles_id, '/wp/v2/global-styles/themes/' . $active_theme, ) ), 'initializer_name' => 'initializeEditor', 'editor_settings' => $settings, ) ); wp_add_inline_script( 'wp-blocks', sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $post ) ) ), 'after' ); wp_enqueue_script( 'wp-edit-site' ); wp_enqueue_script( 'wp-format-library' ); wp_enqueue_style( 'wp-edit-site' ); wp_enqueue_style( 'wp-format-library' ); wp_enqueue_media(); if ( current_theme_supports( 'wp-block-styles' ) || ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) ) { wp_enqueue_style( 'wp-block-library-theme' ); } /** * Fires after block assets have been enqueued for the editing interface. * * Call `add_action` on any hook before 'admin_enqueue_scripts'. * * In the function call you supply, simply use `wp_enqueue_script` and * `wp_enqueue_style` to add your functionality to the block editor. * * @since 5.0.0 */ do_action( 'enqueue_block_editor_assets' ); } add_action( 'admin_enqueue_scripts', 'gutenberg_edit_site_init' ); /** * Register a core site setting for front page information. */ function register_site_editor_homepage_settings() { register_setting( 'reading', 'show_on_front', array( 'show_in_rest' => true, 'type' => 'string', 'description' => __( 'What to show on the front page', 'gutenberg' ), ) ); register_setting( 'reading', 'page_on_front', array( 'show_in_rest' => true, 'type' => 'number', 'description' => __( 'The ID of the page that should be displayed on the front page', 'gutenberg' ), ) ); register_setting( 'reading', 'page_for_posts', array( 'show_in_rest' => true, 'type' => 'number', 'description' => __( 'The ID of the page that should display the latest posts', 'gutenberg' ), ) ); } add_action( 'init', 'register_site_editor_homepage_settings', 10 ); /** * Tells the script loader to load the scripts and styles of custom block on site editor screen. * * @param bool $is_block_editor_screen Current decision about loading block assets. * @return bool Filtered decision about loading block assets. */ function gutenberg_site_editor_load_block_editor_scripts_and_styles( $is_block_editor_screen ) { return ( is_callable( 'get_current_screen' ) && get_current_screen() && 'appearance_page_gutenberg-edit-site' === get_current_screen()->base ) ? true : $is_block_editor_screen; } add_filter( 'should_load_block_editor_scripts_and_styles', 'gutenberg_site_editor_load_block_editor_scripts_and_styles' ); /** * Do a server-side redirection if missing `postType` and `postId` * query args when visiting site editor. * * Note: The `site-editor.php` should handle redirection when migrated into the WP core. * * @return void */ function gutenberg_maybe_redirect_to_homepage() { if ( empty( $_GET['postType'] ) && empty( $_GET['postId'] ) ) { $template = gutenberg_resolve_home_template(); if ( ! $template ) { return; } $redirect_url = add_query_arg( $template, admin_url( 'themes.php?page=gutenberg-edit-site' ) ); wp_safe_redirect( $redirect_url ); } } add_action( 'load-appearance_page_gutenberg-edit-site', 'gutenberg_maybe_redirect_to_homepage' );
Warning: Cannot modify header information - headers already sent by (output started at /htdocs/2.africbio.com/wp-content/plugins/gutenberg/lib/compat/wordpress-5.9/edit-site-page.php:1) in /htdocs/2.africbio.com/wp-includes/pluggable.php on line 1335

Warning: Cannot modify header information - headers already sent by (output started at /htdocs/2.africbio.com/wp-content/plugins/gutenberg/lib/compat/wordpress-5.9/edit-site-page.php:1) in /htdocs/2.africbio.com/wp-includes/pluggable.php on line 1338