woocommerce/plugins/woocommerce-admin/client/index.js

31 lines
650 B
JavaScript
Raw Normal View History

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