Jump to content

Archived

This topic is now archived and is closed to further replies.

sticktrix1

How do i remove "Custom Scripts"

Recommended Posts

sticktrix1

Hey guys, 

I'm using pagelines 1.1.5 at the moment,

 

How can i remove the "Custom Scripts" menu item or feature.

I don't want to allow users to add their own custom javascript or HTML for security reasons.

I've tried editing the panel.code.php file and also used the "PageLines DMS Toolbar Customizer" which didn't work.

Pagelines doesn't load when unsetting the custom design menu item with this plugin either.

 

How can i do this whilst still having custom css/less.

 

Thanks guys

 

Share this post


Link to post
Share on other sites
James B

Hi Casey

 

Did you use the latest version of that plugin, there is an older one still available on the website as well. This is the newer one - http://www.pagelinestheme.com/remove-dms-editor-toolbar-items-2/

 

If you want them to still have access to the DMS control panel, just not the css/less tab, then looking at the code on the plugin site you can use a hook. http://www.pagelinestheme.com/remove-dms-editor-toolbar-items-2/

 

add_filter('pl_toolbar_config','pagelines_dms_toolbar_customizer',11, 2);
function pagelines_dms_toolbar_customizer( $toolbar ){
if(
        !current_user_can('manage_options') // the uncommented items below only get removed for non-Administrators who also have access to the PageLines DMS Editor
        //&& get_current_user_id() !== '1' // could also choose to limit to certain Administrators via user ID
    ){

unset( $toolbar['pl-design']['panel']['user_less']);

    }
 
    return $toolbar;
}

Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
sticktrix1

I did try that but couldn't manage to get it working,

My users are all Administrators, i think that plugin only 'works' when a non-admin tries to access the dms editor? 

 

How could i make it work for all user privileges including Administrator? 

 

Thanks for all your help mate :)

Really appreciate it!

Share this post


Link to post
Share on other sites
sticktrix1

Update:

 

So i managed to get it working by removing 

 

 if(
		!current_user_can('manage_options') // the uncommented items below only get removed for non-Administrators who also have access to the PageLines DMS Editor
		//&& get_current_user_id() !== '1' // could also choose to limit to certain Administrators via user ID
	){

When unsetting the Custom scripts tab/menu, pagelines never loads, it just stalls on the loading screen.

Share this post


Link to post
Share on other sites
Danny

Can you paste the code you have which causes DMS to never load please.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
sticktrix1
unset($toolbar['pl-design']);		//Custom Code
			unset( $toolbar['pl-design']['panel']['user_less']);		// Custom -- Custom LESS/CSS
			unset( $toolbar['pl-design']['panel']['user_scripts']);		// Custom -- Custom Scripts

That's the lines there that cause Pagelines to not load.

Everything else can be unset with no problems. Just this menu item. Which is fine if it weren't such a security risk with JS n html

Share this post


Link to post
Share on other sites

  • Similar Content

    • Steve Webb
      By Steve Webb+
      I am having an issue with DMS editor not loading.  Just keeps spinning and spinning.
      Have tried several things - Logged in and out, cleared cache, deactivated all plugins, but the issue persists.
      I even had our host restore from a backup a few weeks ago, when I know it WAS working, as I edited a text box on the homepage.  The restore from backup didn't help either.
      Also, the front end of the site shows that the site is framed, or boxed now (whatever you call it), instead of full width as it was previously (last week).
      Dev console shows that there are php errors in Google maps - file is attached.
      Can someone please help?  Not sure what else I can do here...
      Thanks in advance.
      -Matt

    • tuciudadenred
      By tuciudadenred+
      Hi everyone, what happens is that the web page metrosalarmas.com has a google tags which I have not attacked where I can look to remove those tags and be able to locate the correct ones.
    • Steve Webb
      By Steve Webb+
      I am having an issue with DMS editor not loading.  Just keeps spinning and spinning.
      Have tried several things - Logged in and out, cleared cache, deactivated all plugins, but the issue persists.
      I even had our host restore from a backup a week ago, when I know it WAS working, as I edited a text box on the homepage.  The restore from backup didn't help either.
      Also, the front end of the site shows that the site is framed, or boxed now (whatever you call it), instead of full width as it was previously (last week).
      Dev console shows that there are php errors in Google maps - file is attached.
      Can someone please help?  Not sure what else I can do here...
      Thanks in advance.
      -Matt

    • JawDesigns
      By JawDesigns
      Hi everyone,
      Flywheel have reported errors on my clients site 'www.racewaredirect.co.uk' and it's not loading. Can someone please provide some information on how to fix this? The site has never experienced these issues before.
      Thanks,
      James Wilson
×