LogoLogo
Official HandbookGutenberg Generatortheme.json Generator
  • Gutenberg WordPress Handbuch
  • Erweiterungen
    • Visual Studio Code | WP Gutenberg Snippets
  • Blocks
    • Standardblocks
    • Snippets
  • Icons
    • WordPress Dashicons
    • FontAwesome 5 Icons
    • Eigene SVG Icons
  • Plugins & Supports
    • Block Picker Preview
    • Block Pattern
    • Option Settings
    • Custom Styles
    • Transform
    • Templates
    • Theme Support
    • Vordefinierte Farben
    • Gutenberg Block Kategorie
    • Vorhandene Blöcke bearbeiten
  • Components
    • Color Component
    • Color Palette – CSS Variablen in Gutenberg
    • Farbverlauf – Component
    • Post Picker
    • Toolbar
    • Innerblocks
    • React Hinweise
    • Redux | React
  • Kontakt & Impressum
Powered by GitBook
On this page
  • Standard Funktion
  • Mittels JavaScript Block Kategorie aktualisieren

Was this helpful?

Export as PDF
  1. Plugins & Supports

Gutenberg Block Kategorie

Falls du deine eigene Block Kategorie haben möchtest, kannst du dies mit dieser PHP Funktion tun.

Standard Funktion

function gutenberg_modul_category( $categories, $post ) {
    
    // Add Category 
    return array_merge(
		array(
            array(
                'slug'  => 'meineblocks',
				'title' => 'POWER + RADACH Blocks'
				'icon'  => 'wordpress'
            ),
        ),
        $categories
    );
}
add_filter( 'block_categories', 'gutenberg_modul_category', 10, 2 );

Mittels JavaScript Block Kategorie aktualisieren

import { prwp_icon } from './icon';

// Set Icon to Block Category PR Module 
wp.blocks.updateCategory('prwpblocks', { 
    icon: prwp_icon
});

PreviousVordefinierte FarbenNextVorhandene Blöcke bearbeiten

Last updated 5 years ago

Was this helpful?