corvée(dépendances) ajoute Carbon Fields

This commit is contained in:
gcch 2024-08-09 18:45:01 +02:00
commit 62368587e5
459 changed files with 72750 additions and 26 deletions

View file

@ -0,0 +1,24 @@
/**
* External dependencies.
*/
import { withSelect } from '@wordpress/data';
import { createHigherOrderComponent } from '@wordpress/compose';
/**
* Creates a high-order component which adds connection
* to the store.
*
* @param {Function} Component
* @return {Function}
*/
export default createHigherOrderComponent( ( Component ) => {
const applyWithSelect = withSelect( ( select, { id } ) => {
const container = select( 'carbon-fields/metaboxes' ).getContainerById( id );
return {
container
};
} );
return applyWithSelect( Component );
}, 'withContainer' );