Skip to content

Commit

Permalink
Revert "Patterns: fix capabilities settings for pattern categories (#…
Browse files Browse the repository at this point in the history
…55379)"

This reverts commit 6f83c92.
  • Loading branch information
Siobhan committed Oct 20, 2023
1 parent 6f83c92 commit a783961
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 482 deletions.
23 changes: 11 additions & 12 deletions lib/compat/wordpress-6.4/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@
*/
function gutenberg_register_taxonomy_patterns() {
$args = array(
'public' => true,
'publicly_queryable' => false,
'hierarchical' => false,
'labels' => array(
'public' => true,
'publicly_queryable' => false,
'hierarchical' => false,
'labels' => array(
'name' => _x( 'Pattern Categories', 'taxonomy general name' ),
'singular_name' => _x( 'Pattern Category', 'taxonomy singular name' ),
),
'query_var' => false,
'rewrite' => false,
'show_ui' => true,
'_builtin' => true,
'show_in_nav_menus' => false,
'show_in_rest' => true,
'show_admin_column' => true,
'rest_controller_class' => 'Gutenberg_REST_Pattern_Categories_Controller',
'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 );
}
Expand Down
24 changes: 0 additions & 24 deletions lib/compat/wordpress-6.4/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,3 @@ function gutenberg_add_custom_capabilities_to_wp_block( $args ) {
return $args;
}
add_filter( 'register_wp_block_post_type_args', 'gutenberg_add_custom_capabilities_to_wp_block', 10, 1 );

/**
* Updates the wp_block REST enpoint in order to modify the wp_pattern_category action
* links that are returned because as although the taxonomy is flat Author level users
* are only allowed to assign categories.
*
* Note: This should be removed when the minimum required WP version is >= 6.4.
*
* @see https://github.com/WordPress/gutenberg/pull/55379
*
* @param array $args Register post type args.
* @param string $post_type The post type string.
*
* @return array Register post type args.
*/
function gutenberg_update_patterns_block_rest_controller_class( $args, $post_type ) {
if ( 'wp_block' === $post_type ) {
$args['rest_controller_class'] = 'Gutenberg_REST_Blocks_Controller_6_4';
}

return $args;
}

add_filter( 'register_post_type_args', 'gutenberg_update_patterns_block_rest_controller_class', 11, 2 );

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ function gutenberg_is_experiment_enabled( $name ) {
// WordPress 6.4 compat.
require_once __DIR__ . '/compat/wordpress-6.4/class-gutenberg-rest-global-styles-revisions-controller-6-4.php';
require_once __DIR__ . '/compat/wordpress-6.4/class-gutenberg-rest-block-patterns-controller.php';
require_once __DIR__ . '/compat/wordpress-6.4/class-gutenberg-rest-blocks-controller-6-4.php';
require_once __DIR__ . '/compat/wordpress-6.4/class-gutenberg-rest-pattern-categories-controller.php';
require_once __DIR__ . '/compat/wordpress-6.4/rest-api.php';
require_once __DIR__ . '/compat/wordpress-6.4/theme-previews.php';

Expand Down
1 change: 0 additions & 1 deletion packages/core-data/src/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ export const getUserPatternCategories =
{
per_page: -1,
_fields: 'id,name,description,slug',
context: 'view',
}
);

Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export {
export { default as PostTaxonomies } from './post-taxonomies';
export { FlatTermSelector as PostTaxonomiesFlatTermSelector } from './post-taxonomies/flat-term-selector';
export { HierarchicalTermSelector as PostTaxonomiesHierarchicalTermSelector } from './post-taxonomies/hierarchical-term-selector';
export { PatternCategoriesSelector as PostPatternCategoriesSelector } from './post-taxonomies/pattern-categories-selector';
export { default as PostTaxonomiesCheck } from './post-taxonomies/check';
export { default as PostTextEditor } from './post-text-editor';
export { default as PostTitle } from './post-title';
Expand Down

This file was deleted.

Loading

0 comments on commit a783961

Please sign in to comment.