• Resolved thejaydip

    (@iamjaydip)


    Is there any trick to remove default remote templates from the Elementor template library?

    I have tried the below code to remove default remote templates and it’s working fine but removing my custom templates too.

    
    /**
     * Register our custom source.
     */
    add_action( 'elementor/init', function() {
    	include 'includes/source.php';
    	
    	// Unregister source with closure binding, thank Steve.
    	$unregister_source = function($id) {
    		unset( $this->_registered_sources[ $id ] );
    	};
    	$unregister_source->call( \Elementor\Plugin::instance()->templates_manager, 'remote');
    	\Elementor\Plugin::instance()->templates_manager->register_source( 'Elementor\TemplateLibrary\Source_Custom' );
    }, 15 );

    Thank you

    • This topic was modified 3 years ago by thejaydip.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,

    Can you please send us your site URL?

    Also, what do you mean by removing default remote templates?

    Thread Starter thejaydip

    (@iamjaydip)

    Since the latest updates, I can’t remove only Elementor’s default templates in library using code. This site is under maintenance and I am not user at Elementor Pro.

    Please see below attached screenshots.

    https://prnt.sc/26vzli6
    https://prnt.sc/26vzo3s

    Thanks

    Hi,

    I have found an answer in our GitHub that might help the situation –

    in your theme js:

    var elementorEditorCSS = top.document.createElement(“link”);
    elementorEditorCSS.href = “/wp-content/themes/hello-elementor-child/elementor-editor.css”;
    elementorEditorCSS.rel = “stylesheet”;
    elementorEditorCSS.type = “text/css”;
    top.document.body.appendChild(elementorEditorCSS);
    adjust for your theme folders name

    in your theme folder create file elementor-editor.css:

    .elementor-template-library-menu-item[data-tab=”templates/blocks”],
    .elementor-template-library-menu-item[data-tab=”templates/pages”],
    #elementor-template-library-templates[data-template-source=”remote”] {
    display: none;
    }

    https://github.com/elementor/elementor/issues/2528

    Please update us when you can.

    @iamjaydip Are you ok?

    Thread Starter thejaydip

    (@iamjaydip)

    No, How to hide the default templates ( except custom remotely my templates ) in the library without hiding the library menu items?

    Thanks

    Hi,

    Since this is a development-based query, may opt to visit our Github account where you may get in contact with a member of our development team to query this with.
    Please note that this is not an official support channel but a respective member of the development team will respond to your post as soon as they are available.

    Please follow this guide which outlines the steps required to post on our Github: https://github.com/elementor/elementor/blob/master/.github/CONTRIBUTING.md

    Hello,
    i tested the code and it works. Thanks.
    /**/

    in your theme js:
    
    var elementorEditorCSS = top.document.createElement("link");
    elementorEditorCSS.href = "/wp-content/themes/hello-elementor-child/elementor-editor.css";
    elementorEditorCSS.rel = "stylesheet";
    elementorEditorCSS.type = "text/css";
    top.document.body.appendChild(elementorEditorCSS);
    adjust for your theme folders name
    
    in your theme folder create file elementor-editor.css:
    
    .elementor-template-library-menu-item[data-tab="templates/blocks"],
    .elementor-template-library-menu-item[data-tab="templates/pages"],
    #elementor-template-library-templates[data-template-source="remote"] {
    	display: none;
    }

    /**/

    I have the following question: can this code be bound to a specific role, for example ”custom-author”.
    “Administrator” should be able to see and use the templates, but “custom-author” should be restricted.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Remove default remote templates from the Elementor template library’ is closed to new replies.