How to use the @wordpress/plugins.getPlugins function in @wordpress/plugins

To help you get started, we’ve selected a few @wordpress/plugins examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / wordpress__plugins / wordpress__plugins-tests.tsx View on Github external
import * as plugins from '@wordpress/plugins';

plugins.registerPlugin('my-plugin', {
    icon: 'welcome-learn-more',
    render: () =&gt; <h1>Hello World</h1>,
});

plugins.getPlugins();

plugins.getPlugin('my-plugin');

plugins.unregisterPlugin('my-plugin');

interface OwnProps {
    foobar: number;
}

interface ContextProps {
    iconName: string;
}

type Props = OwnProps &amp; ContextProps;

const Foo = ({ iconName, foobar }: Props) =&gt; (

@wordpress/plugins

Plugins module for WordPress.

GPL-2.0-or-later
Latest version published 12 days ago

Package Health Score

95 / 100
Full package analysis