2018-04-17 23:51:48 +00:00
|
|
|
/** @format */
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2018-05-03 14:15:36 +00:00
|
|
|
import { APIProvider } from '@wordpress/components';
|
2018-04-17 23:51:48 +00:00
|
|
|
import { createElement, render } from '@wordpress/element';
|
|
|
|
import { addFilter } from '@wordpress/hooks';
|
2018-05-03 14:15:36 +00:00
|
|
|
import { pick } from 'lodash';
|
2018-04-17 23:51:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import Dashboard from './dashboard';
|
|
|
|
|
|
|
|
render(
|
2018-05-14 13:41:30 +00:00
|
|
|
createElement(
|
|
|
|
APIProvider,
|
|
|
|
{
|
|
|
|
...wpApiSettings,
|
|
|
|
...pick( wp.api, [ 'postTypeRestBaseMapping', 'taxonomyRestBaseMapping' ] ),
|
|
|
|
},
|
|
|
|
createElement( Dashboard )
|
|
|
|
),
|
2018-04-17 23:51:48 +00:00
|
|
|
document.getElementById( 'root' )
|
|
|
|
);
|
|
|
|
|
2018-05-03 18:38:12 +00:00
|
|
|
function editText( string ) {
|
2018-04-17 23:51:48 +00:00
|
|
|
return `Filtered: ${ string }`;
|
|
|
|
}
|
2018-05-03 18:38:12 +00:00
|
|
|
addFilter( 'woodash.example', 'editText', editText );
|