Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Disable Global Styles & Asset Library

  • Hello there!

    I’d like to know if it is possible to disable Global Styles on GenerateBlocks, and also Asset Library.
    We do not use them on our webistes, and for us it would be better to just disable these features on GenerateBlocks.

    Also, is it possible to remove the “Active Elements” metabox on the post edit page? Talking about this one: https://snipboard.io/T92CSq.jpg

    Thanks!

  • Hi there,

    to remove the admin menu items you can use this PHP Snippet:

    
    function remove_nested_menu_items() {
        remove_submenu_page( 'generateblocks', 'generateblocks-styles' );
        remove_submenu_page( 'generateblocks', 'generateblocks-asset-library' );    
    }
    add_action( 'admin_menu', 'remove_nested_menu_items' );
    

    For the elements panel, see here:

    https://generate.support/topic/disable-active-elements-for-non-admin-users/#post-33319

  • Hi David!

    For the elements panel, it worked!
    But for the GenerateBlocks one, it didn’t… with the function you gave me, it continues to appear, as can be seen here: https://snipboard.io/NCImQR.jpg

    Any other solution?

  • Hi there,

    Update David’s code above with this one:

    function remove_nested_menu_items() {
        remove_submenu_page( 'generateblocks', 'edit.php?post_type=gblocks_global_style' );
        remove_submenu_page( 'generateblocks', 'generateblocks-asset-library' );    
    }
    add_action( 'admin_menu', 'remove_nested_menu_items' );
    
    function remove_new_item_from_admin_bar( $wp_admin_bar ) {
        $wp_admin_bar->remove_node( 'new-gblocks_templates' );
    	$wp_admin_bar->remove_node( 'new-gblocks_global_style' );
    }
    add_action( 'admin_bar_menu', 'remove_new_item_from_admin_bar', 999 );
  • Thanks, Alvin!

    Worked fine!

  • Glad to hear that!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.