Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function gdt_blocks_class_rename() {
- if ( current_user_can( 'contributor' ) || current_user_can('author') ) {
- wp_enqueue_script( 'gdt-plugin-blacklist-blocks', get_stylesheet_directory_uri() . '/custom-js/guten-addons.js', array( 'wp-blocks', 'wp-hooks', 'wp-element', 'wp-edit-post' ));
- }
- }
- add_action( 'enqueue_block_editor_assets', 'gdt_blocks_class_rename' );
- ( function( wp ) {
- function modifyLinkDestinationDefault(settings, name) {
- if (name !== "core/image") {
- return settings;
- }
- settings.attributes.linkDestination.default = "media";
- return settings;
- }
- wp.hooks.addFilter(
- "blocks.registerBlockType",
- "my-plugin/modify-linkDestination-default",
- modifyLinkDestinationDefault
- );
- } )( window.wp );
- ( function( wp ) {
- function modifyLinkDestinationGalleyDefault(settings, name) {
- if (name !== "core/gallery") {
- return settings;
- }
- settings.attributes.linkTo.default = "media";
- return settings;
- }
- wp.hooks.addFilter(
- "blocks.registerBlockType",
- "my-plugin/modify-linkDestination-gallery-default",
- modifyLinkDestinationGalleyDefault
- );
- } )( window.wp );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement