get_default_block_categories example


function get_block_categories( $post_or_block_editor_context ) {
    $block_categories     = get_default_block_categories();
    $block_editor_context = $post_or_block_editor_context instanceof WP_Post ?
        new WP_Block_Editor_Context(
            array(
                'post' => $post_or_block_editor_context,
            )
        ) : $post_or_block_editor_context;

    /** * Filters the default array of categories for block types. * * @since 5.8.0 * * @param array[] $block_categories Array of categories for block types. * @param WP_Block_Editor_Context $block_editor_context The current block editor context. */
Home | Imprint | This part of the site doesn't use cookies.