diff --git a/features/icon-collection.feature b/features/icon-collection.feature index 88e2ec49b..bc54a48a3 100644 --- a/features/icon-collection.feature +++ b/features/icon-collection.feature @@ -71,24 +71,24 @@ Feature: Manage WordPress icon collections 'Test Icons', - 'description' => 'A collection for testing.', - ) - ); - - wp_register_icon( - 'test-icons/square', - array( - 'label' => 'Square', - 'content' => '', - ) - ); - } + 'init', + function () { + wp_register_icon_collection( + 'test-icons', + array( + 'label' => 'Test Icons', + 'description' => 'A collection for testing.', + ) + ); + + wp_register_icon( + 'test-icons/square', + array( + 'label' => 'Square', + 'content' => '', + ) + ); + } ); """ diff --git a/features/icon.feature b/features/icon.feature index 107ac3e1b..e2e9296ea 100644 --- a/features/icon.feature +++ b/features/icon.feature @@ -151,24 +151,24 @@ Feature: Manage WordPress SVG icons 'Test Icons', - 'description' => 'A collection for testing.', - ) - ); - - wp_register_icon( - 'test-icons/square', - array( - 'label' => 'Square', - 'content' => '', - ) - ); - } + 'init', + function () { + wp_register_icon_collection( + 'test-icons', + array( + 'label' => 'Test Icons', + 'description' => 'A collection for testing.', + ) + ); + + wp_register_icon( + 'test-icons/square', + array( + 'label' => 'Square', + 'content' => '', + ) + ); + } ); """ diff --git a/features/post-block.feature b/features/post-block.feature index e0b5daac2..95cbd58d1 100644 --- a/features/post-block.feature +++ b/features/post-block.feature @@ -587,20 +587,20 @@ Feature: Manage blocks in post content """ ]*)>/', - '
', - $block['innerHTML'] - ); - $block['innerContent'] = [ $block['innerHTML'] ]; - } - return $block; - }, - 10, - 3 + 'wp_cli_post_block_update_html', + function ( $block, $new_attrs, $block_name ) { + if ( 'core/paragraph' === $block_name && isset( $new_attrs['customClass'] ) ) { + $block['innerHTML'] = preg_replace( + '/
]*)>/', + '
', + $block['innerHTML'] + ); + $block['innerContent'] = [ $block['innerHTML'] ]; + } + return $block; + }, + 10, + 3 ); """ When I run `wp post create --post_title="Block Post" --post_content="
Hello World
" --porcelain` diff --git a/features/taxonomy.feature b/features/taxonomy.feature index a2d1b07c2..28450773d 100644 --- a/features/taxonomy.feature +++ b/features/taxonomy.feature @@ -55,20 +55,20 @@ Feature: Manage WordPress taxonomies true, - 'show_ui' => true, - 'show_admin_column' => true, - 'update_count_callback' => '_update_post_term_count', - 'query_var' => true, - 'labels' => array( - 'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ), - ), - ); - register_taxonomy( 'genres', array( 'post', 'page' ), $args ); - } + 'init', + function () { + $args = array( + 'hierarchical' => true, + 'show_ui' => true, + 'show_admin_column' => true, + 'update_count_callback' => '_update_post_term_count', + 'query_var' => true, + 'labels' => array( + 'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ), + ), + ); + register_taxonomy( 'genres', array( 'post', 'page' ), $args ); + } ); """ @@ -95,20 +95,20 @@ Feature: Manage WordPress taxonomies true, - 'show_ui' => true, - 'show_admin_column' => true, - 'update_count_callback' => '_update_post_term_count', - 'query_var' => true, - 'labels' => array( - 'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ), - ), - ); - register_taxonomy( 'genres', array( 'post', 'page' ), $args ); - } + 'init', + function () { + $args = array( + 'hierarchical' => true, + 'show_ui' => true, + 'show_admin_column' => true, + 'update_count_callback' => '_update_post_term_count', + 'query_var' => true, + 'labels' => array( + 'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ), + ), + ); + register_taxonomy( 'genres', array( 'post', 'page' ), $args ); + } ); """ diff --git a/features/term-migrate.feature b/features/term-migrate.feature index 0234d4b9b..eaac4f3f6 100644 --- a/features/term-migrate.feature +++ b/features/term-migrate.feature @@ -96,11 +96,11 @@ Feature: Migrate term custom fields true ] ); - register_taxonomy( 'topic', 'news', [ 'public' => true ] ); - } + 'init', + function () { + register_post_type( 'news', [ 'public' => true ] ); + register_taxonomy( 'topic', 'news', [ 'public' => true ] ); + } ); """ diff --git a/features/user-term.feature b/features/user-term.feature index e476e91bc..bf7a359a4 100644 --- a/features/user-term.feature +++ b/features/user-term.feature @@ -7,7 +7,7 @@ Feature: Manage user term