• Resolved politicske

    (@politicske)


    Hi. Would you mind introducing an option to remove the Pinterest block (or any other block from this plugin) from the editor? I don’t use it and I am trying to find ways to declutter my editor. Or if you have a PHP code I can use (functions.php) let me know. Thanks in advance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    Scriptless registers just one block, but you can add this to your functions.php file to unregister it:

    
    add_action( 'init', 'rgc_unregister_scriptless_block', 20 );
    /**
     * Remove the Scriptless Social Sharing block if it has been registered.
     */
    function rgc_unregister_scriptless_block() {
    	$block_name = 'scriptlesssocialsharing/buttons';
    	if ( ! WP_Block_Type_Registry::get_instance()->is_registered( $block_name ) ) {
    		return;
    	}
    	WP_Block_Type_Registry::get_instance()->unregister( $block_name );
    }
    

    I can look into adding an option to not register the block at all. Thank you for the suggestion.

    Thread Starter politicske

    (@politicske)

    It did not work (using code snippets plugin). Let me just wait for when you implement it.

    • This reply was modified 5 years, 7 months ago by politicske.
    Plugin Author Robin Cornett

    (@littlerchicken)

    The develop branch of the plugin on Github has this option added, if you have a place to try out a beta version of 3.1.0. There are quite a few changes in this version, which you can see in the changelog on Github. I hope to finish testing and release it within the next week or so.

    Thread Starter politicske

    (@politicske)

    No problem. Thank you very much for all the effort and support you put into the plugin.

    Thread Starter politicske

    (@politicske)

    Hi @littlerchicken what I meant with this is to (also) remove the Pinterest image sharing block (or what are they called?) from the block editor’s sidebar. How do I do that? The new update does not resolve that either.

    Thread Starter politicske

    (@politicske)

    Found a snippet to hide it with CSS.

    Plugin Author Robin Cornett

    (@littlerchicken)

    In the block editor, if you click on the three dots in the upper right of the screen to access the “More tools & options”, then click Options at the bottom of that, you can disable the Scriptless Social Sharing metabox under the Advanced Panels section to hide it that way.

    Thread Starter politicske

    (@politicske)

    I found some code from my theme author and targeted the metabox (found this is the correct term) ID and I was able to unhook it. I found unticking did not work always and the metaboxes kept coming back after a while. Thanks anyway.

    add_action( 'add_meta_boxes', function() {
    	remove_meta_box( 'scriptless_social_sharing', 'post', 'side' );
    }, 999 );
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Disable block’ is closed to new replies.