Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (
);
},
} );
}
// Always register ability to open from document sidebar.
registerPlugin( 'page-templates-sidebar', {
render: () => {
return (
import { Fragment } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { registerPlugin } from '@wordpress/plugins';
// GUTENBERG JS - use addQueryArgs instead of hard coding
// 'edit.php?post_type=wp_block'
import { addQueryArgs } from '@wordpress/url';
/**
* Internal dependencies
*/
import CopyContentMenuItem from './copy-content-menu-item';
import KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';
import ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';
registerPlugin( 'edit-post', {
render() {
return (
{ ( { onClose } ) => (
<menuitem href="{" role="menuitem">
{ __( 'Manage All Reusable Blocks' ) }
</menuitem>
) }
// Simple track - just based on the event name.
tracksRecordEvent( tracker );
} else if ( typeof tracker === 'function' ) {
// Advanced tracking - call function.
tracker( ...args );
}
return originalAction( ...args );
};
} );
}
return actions;
},
} ) );
// Registers Plugin.
registerPlugin( 'wpcom-block-editor-tracking', {
render: () => {
EVENT_TYPES.forEach( eventType =>
document.addEventListener( eventType, delegateEventTracking )
);
return null;
},
} );
}
import * as plugins from '@wordpress/plugins';
plugins.registerPlugin('my-plugin', {
icon: 'welcome-learn-more',
render: () => <h1>Hello World</h1>,
});
plugins.getPlugins();
plugins.getPlugin('my-plugin');
plugins.unregisterPlugin('my-plugin');
interface OwnProps {
foobar: number;
}
interface ContextProps {
iconName: string;
InserterIconImage: (
<img src="data:image/svg+xml;charset=utf8,%3Csvg width='18' height='18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.824 0C3.97 0 0 3.97 0 8.824c0 4.853 3.97 8.824 8.824 8.824 4.853 0 8.824-3.971 8.824-8.824S13.677 0 8.824 0zM7.94 5.294v2.647H5.294v1.765h2.647v2.647h1.765V9.706h2.647V7.941H9.706V5.294H7.941zm-6.176 3.53c0 3.882 3.176 7.059 7.059 7.059 3.882 0 7.059-3.177 7.059-7.06 0-3.882-3.177-7.058-7.06-7.058-3.882 0-7.058 3.176-7.058 7.059z' fill='%234A4A4A'/%3E%3Cmask id='a' maskUnits='userSpaceOnUse' x='0' y='0' width='18' height='18'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.824 0C3.97 0 0 3.97 0 8.824c0 4.853 3.97 8.824 8.824 8.824 4.853 0 8.824-3.971 8.824-8.824S13.677 0 8.824 0zM7.94 5.294v2.647H5.294v1.765h2.647v2.647h1.765V9.706h2.647V7.941H9.706V5.294H7.941zm-6.176 3.53c0 3.882 3.176 7.059 7.059 7.059 3.882 0 7.059-3.177 7.059-7.06 0-3.882-3.177-7.058-7.06-7.058-3.882 0-7.058 3.176-7.058 7.059z' fill='%23fff'/%3E%3C/mask%3E%3Cg mask='url(%23a)'%3E%3Cpath fill='%23444' d='M0 0h17.644v17.644H0z'/%3E%3C/g%3E%3C/svg%3E" alt="{">
),
}
) }
<p></p>
);
}
registerPlugin( 'wpcom-block-editor-nux', {
render: () => ,
} );
{ __( 'Select a template' ) }
);
} );
if ( 'page' === fullSiteEditing.editorPostType ) {
registerPlugin( 'fse-template-selector-sidebar', {
render: TemplateSelectorSidebar,
} );
}
import { icon } from './icon.js';
/**
* Load dependencies.
*/
import { compose } from '@wordpress/compose';
import { withSelect, withDispatch } from '@wordpress/data';
import { registerPlugin } from '@wordpress/plugins';
import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post';
import { PanelBody, PanelRow, TextControl, NumberControl, RangeControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
/**
* Register the plugin.
*/
registerPlugin( 'charitable-sidebar', {
icon: icon,
render: () => {
return (
<>
{ __( 'Campaign Settings', 'charitable' ) }
appendSubtitleToTitleDOMElement( subtitle );
}, [ subtitle ] );
return (
{ __( 'Set a Subtitle for the Article', 'newspack' ) }
);
};
registerPlugin( 'plugin-document-setting-panel-newspack-subtitle', {
render: connectWithSelect( NewspackSubtitlePanel ),
icon: null,
} );
import SidebarUnsplash from "./components/unsplash/sidebar";
import SidebarGiphy from "./components/giphy/sidebar";
import MenuItemUnsplash from "./components/unsplash/menu-item";
import MenuItemGiphy from "./components/giphy/menu-item";
const Dropit = () => (
);
registerPlugin("dropit", {
render: Dropit
});
import { createSlotFill } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post';
import { registerPlugin } from '@wordpress/plugins';
/**
* Internal dependencies
*/
import './jetpack-plugin-sidebar.scss';
import JetpackLogo from './jetpack-logo';
const { Fill, Slot } = createSlotFill( 'JetpackPluginSidebar' );
export { Fill as default };
registerPlugin( 'jetpack-sidebar', {
render: () => (
{ fills => {
if ( ! fills.length ) {
return null;
}
return (
}>
Jetpack
}>
{ fills }