Skip to content
Open
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 build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-element', 'wp-primitives'), 'version' => 'dbde4f9236cac7bb5e6c');
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices'), 'version' => '0b0a740dd46e37c7afcc');
183 changes: 182 additions & 1 deletion build/index.js

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions dashboard-wp-components.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,47 @@ function page_render_markup()
# Root node for React mount
echo "<div id='demo-app'></div>";
}

/**
* Register settings for the DataForm demo.
*/
function dashboard_register_settings() {
$default = array(
'message' => __( 'Hello, World!', 'dashboard-wp-components' ),
'display' => true,
'size' => 'medium',
);
$schema = array(
'type' => 'object',
'properties' => array(
'message' => array(
'type' => 'string',
),
'display' => array(
'type' => 'boolean',
),
'size' => array(
'type' => 'string',
'enum' => array(
'small',
'medium',
'large',
'x-large',
),
),
),
);

register_setting(
'options',
'dashboard_demo_settings',
array(
'type' => 'object',
'default' => $default,
'show_in_rest' => array(
'schema' => $schema,
),
)
);
}
add_action( 'init', __NAMESPACE__ . '\dashboard_register_settings' );
Loading