-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patterns: Register new media related categories (#55236)
- Loading branch information
1 parent
58064cc
commit 343b903
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* Extends Core's wp-includes/block-patterns.php to add new media related | ||
* pattern categories for WP 6.5. | ||
* | ||
* @package gutenberg | ||
*/ | ||
|
||
/** | ||
* Adds new pattern categories for better organization of media related patterns. | ||
* | ||
* Note: This should be removed when the minimum required WP version is >= 6.5. | ||
* | ||
* @return void | ||
*/ | ||
function gutenberg_register_media_pattern_categories() { | ||
// Register new categories. | ||
register_block_pattern_category( | ||
'videos', | ||
array( | ||
'label' => _x( 'Videos', 'Block pattern category' ), | ||
'description' => __( 'Different layouts containing videos.' ), | ||
) | ||
); | ||
register_block_pattern_category( | ||
'audio', | ||
array( | ||
'label' => _x( 'Audio', 'Block pattern category' ), | ||
'description' => __( 'Different layouts containing audio.' ), | ||
) | ||
); | ||
} | ||
add_action( 'init', 'gutenberg_register_media_pattern_categories' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters