Skip to content

Commit

Permalink
DataViews: make the experiment about custom views (#60813)
Browse files Browse the repository at this point in the history
Co-authored-by: oandregal <oandregal@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
  • Loading branch information
3 people authored Apr 17, 2024
1 parent e44ba47 commit 3a07928
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/experimental/data-views.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
function _gutenberg_register_data_views_post_type() {
$gutenberg_experiments = get_option( 'gutenberg-experiments' );
if ( empty( $gutenberg_experiments ) || ! array_key_exists( 'gutenberg-dataviews', $gutenberg_experiments ) ) {
if ( empty( $gutenberg_experiments ) || ! array_key_exists( 'gutenberg-custom-dataviews', $gutenberg_experiments ) ) {
return;
}
register_post_type(
Expand Down
4 changes: 2 additions & 2 deletions lib/experimental/editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ function gutenberg_enable_experiments() {
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-zoomed-out-view', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableZoomedOutView = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-dataviews', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalAdminViews = true', 'before' );
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-custom-dataviews', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalCustomViews = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-color-randomizer', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableColorRandomizer = true', 'before' );
Expand Down
8 changes: 4 additions & 4 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ function gutenberg_initialize_experiments_settings() {
);

add_settings_field(
'gutenberg-dataviews',
__( 'New admin views', 'gutenberg' ),
'gutenberg-custom-dataviews',
__( 'Custom dataviews', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Test the new views for different entities like pages.', 'gutenberg' ),
'id' => 'gutenberg-dataviews',
'label' => __( 'Test the custom dataviews in the pages page.', 'gutenberg' ),
'id' => 'gutenberg-custom-dataviews',
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function DataViewsSidebarContent() {
);
} ) }
</ItemGroup>
{ window?.__experimentalAdminViews && (
{ window?.__experimentalCustomViews && (
<CustomDataViewsList
activeView={ activeView }
type={ type }
Expand Down

0 comments on commit 3a07928

Please sign in to comment.