-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override all the labels of the pattern categories taxonomy #57094
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -31,3 +31,50 @@ function gutenberg_register_media_pattern_categories() { | |
); | ||
} | ||
add_action( 'init', 'gutenberg_register_media_pattern_categories' ); | ||
|
||
/** | ||
* Adds a new taxonomy for organizing user created patterns. | ||
* | ||
* Note: This should be removed when the minimum required WP version is >= 6.4. | ||
* | ||
* @see https://github.com/WordPress/gutenberg/pull/53163 | ||
youknowriad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* @return void | ||
*/ | ||
function gutenberg_register_taxonomy_patterns() { | ||
$args = array( | ||
'public' => false, | ||
'publicly_queryable' => false, | ||
'hierarchical' => false, | ||
'labels' => array( | ||
'name' => _x( 'Pattern Categories', 'taxonomy general name' ), | ||
'singular_name' => _x( 'Pattern Category', 'taxonomy singular name' ), | ||
'add_new_item' => __( 'Add New Pattern Category' ), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
'add_or_remove_items' => __( 'Add or remove pattern categories' ), | ||
'back_to_items' => __( '← Go to pattern categories' ), | ||
'choose_from_most_used' => __( 'Choose from the most used pattern categories' ), | ||
'edit_item' => __( 'Edit Pattern Category' ), | ||
'item_link' => __( 'Pattern Category Link' ), | ||
'item_link_description' => __( 'A link to a pattern category.' ), | ||
'items_list' => __( 'Pattern Categories list' ), | ||
'items_list_navigation' => __( 'Pattern Categories list navigation' ), | ||
'new_item_name' => __( 'New Pattern Category Name' ), | ||
'no_terms' => __( 'No pattern categories' ), | ||
'not_found' => __( 'No pattern categories found.' ), | ||
'popular_items' => __( 'Popular Pattern Categories' ), | ||
'search_items' => __( 'Search Pattern Categories' ), | ||
'separate_items_with_commas' => __( 'Separate pattern categories with commas' ), | ||
'update_item' => __( 'Update Pattern Category' ), | ||
'view_item' => __( 'View Pattern Category' ), | ||
), | ||
'query_var' => false, | ||
'rewrite' => false, | ||
'show_ui' => true, | ||
'_builtin' => true, | ||
'show_in_nav_menus' => false, | ||
'show_in_rest' => true, | ||
'show_admin_column' => true, | ||
); | ||
register_taxonomy( 'wp_pattern_category', array( 'wp_block' ), $args ); | ||
} | ||
add_action( 'init', 'gutenberg_register_taxonomy_patterns' ); |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just double-checking it's ok to remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it's fine, it was moved.