Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataViews: make the experiment about custom views #60813

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading