Skip to content

Commit 4b5ecb2

Browse files
committed
Remove filters
1 parent 66989a8 commit 4b5ecb2

File tree

2 files changed

+0
-59
lines changed

2 files changed

+0
-59
lines changed

lib/compat/wordpress-5.9/template-parts.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -100,36 +100,6 @@ function gutenberg_register_wp_template_part_area_taxonomy() {
100100
}
101101
add_action( 'init', 'gutenberg_register_wp_template_part_area_taxonomy' );
102102

103-
/**
104-
* Fixes the label of the 'wp_template_part' admin menu entry.
105-
*/
106-
function gutenberg_fix_template_part_admin_menu_entry() {
107-
if ( ! gutenberg_supports_block_templates() ) {
108-
return;
109-
}
110-
111-
global $submenu;
112-
if ( ! isset( $submenu['themes.php'] ) ) {
113-
return;
114-
}
115-
$post_type = get_post_type_object( 'wp_template_part' );
116-
if ( ! $post_type ) {
117-
return;
118-
}
119-
foreach ( $submenu['themes.php'] as $key => $submenu_entry ) {
120-
if ( $post_type->labels->all_items === $submenu['themes.php'][ $key ][0] ) {
121-
$submenu['themes.php'][ $key ][0] = $post_type->labels->menu_name; // phpcs:ignore WordPress.WP.GlobalVariablesOverride
122-
break;
123-
}
124-
}
125-
}
126-
add_action( 'admin_menu', 'gutenberg_fix_template_part_admin_menu_entry' );
127-
128-
// Customize the `wp_template` admin list.
129-
add_filter( 'manage_wp_template_part_posts_columns', 'gutenberg_templates_lists_custom_columns' );
130-
add_action( 'manage_wp_template_part_posts_custom_column', 'gutenberg_render_templates_lists_custom_column', 10, 2 );
131-
add_filter( 'views_edit-wp_template_part', 'gutenberg_filter_templates_edit_views' );
132-
133103
/**
134104
* Sets a custom slug when creating auto-draft template parts.
135105
* This is only needed for auto-drafts created by the regular WP editor.

lib/compat/wordpress-5.9/templates.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -127,35 +127,6 @@ function gutenberg_grant_template_caps( array $allcaps ) {
127127
}
128128
add_filter( 'user_has_cap', 'gutenberg_grant_template_caps' );
129129

130-
/**
131-
* Fixes the label of the 'wp_template' admin menu entry.
132-
*/
133-
function gutenberg_fix_template_admin_menu_entry() {
134-
if ( ! gutenberg_supports_block_templates() ) {
135-
return;
136-
}
137-
global $submenu;
138-
if ( ! isset( $submenu['themes.php'] ) ) {
139-
return;
140-
}
141-
$post_type = get_post_type_object( 'wp_template' );
142-
if ( ! $post_type ) {
143-
return;
144-
}
145-
foreach ( $submenu['themes.php'] as $key => $submenu_entry ) {
146-
if ( $post_type->labels->all_items === $submenu['themes.php'][ $key ][0] ) {
147-
$submenu['themes.php'][ $key ][0] = $post_type->labels->menu_name; // phpcs:ignore WordPress.WP.GlobalVariablesOverride
148-
break;
149-
}
150-
}
151-
}
152-
add_action( 'admin_menu', 'gutenberg_fix_template_admin_menu_entry' );
153-
154-
// Customize the `wp_template` admin list.
155-
add_filter( 'manage_wp_template_posts_columns', 'gutenberg_templates_lists_custom_columns' );
156-
add_action( 'manage_wp_template_posts_custom_column', 'gutenberg_render_templates_lists_custom_column', 10, 2 );
157-
add_filter( 'views_edit-wp_template', 'gutenberg_filter_templates_edit_views' );
158-
159130
/**
160131
* Sets a custom slug when creating auto-draft templates.
161132
* This is only needed for auto-drafts created by the regular WP editor.

0 commit comments

Comments
 (0)