File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,3 +128,14 @@ Feature: Empty a WordPress site of its data
128128
129129 When I run `wp --url=example.com/foo post list --format=ids`
130130 Then STDOUT should be empty
131+
132+ @require-wp-6.1
133+ Scenario : Empty a multisite site without deprecation notices
134+ Given a WP multisite installation
135+ And I run `wp config set WP_DEBUG true --raw`
136+
137+ When I run `wp site empty --yes`
138+ Then STDERR should not contain:
139+ """
140+ global_terms_enabled
141+ """
Original file line number Diff line number Diff line change @@ -118,8 +118,9 @@ private function insert_default_terms() {
118118 /* translators: Default category slug */
119119 $ cat_slug = sanitize_title ( _x ( 'Uncategorized ' , 'Default category slug ' ) );
120120
121+ // global_terms_enabled() is deprecated since WP 6.1, where global terms are always off.
121122 // @phpstan-ignore function.deprecated
122- if ( global_terms_enabled () ) { // phpcs:ignore WordPress.WP.DeprecatedFunctions.global_terms_enabledFound -- Required for backwards compatibility.
123+ if ( Utils \wp_version_compare ( ' 6.1 ' , ' < ' ) && global_terms_enabled () ) { // phpcs:ignore WordPress.WP.DeprecatedFunctions.global_terms_enabledFound -- Required for backwards compatibility.
123124 $ cat_id = $ wpdb ->get_var ( $ wpdb ->prepare ( "SELECT cat_ID FROM {$ wpdb ->sitecategories } WHERE category_nicename = %s " , $ cat_slug ) );
124125 if ( null === $ cat_id ) {
125126 $ wpdb ->insert (
You can’t perform that action at this time.
0 commit comments