Upfront - prevent future editing

Hi,
I would like to prevent my Upfront theme from being edited by my client. Which parts of code do I have to add or remove to make the Upfront editing interface inaccessible?
Hope you can help me and thanks in advance!

Best regards,
Christian

  • Bojan Radonic

    Hey there @Christian, hope you're well today!

    I guess the easiest way to do this would be to just hide the admin bar link with some custom CSS.

    You could use Ultimate Branding plugin and Custom Admin Bar module which can be activated in Branding -> Branding and after the module is activated just add the following CSS in Admin Bar CSS Styles in Branding -> Admin Bar:

    #ub_admin_bar_wrap li#wp-admin-bar-upfront-edit_layout {
      display: none;
    }

    If you don't want to add another plugin and the way for your client to see this within admin area you can use mu plugins for the same job. I've made a simple plugin that will do that, just download the file, extract it and move it to /wp-content/mu-plugins/ folder, if you don't have one there please create it.

    This should remove Upfront link in the admin bar.

    Please let me know if this helps :slight_smile:

    Best regards,
    Bojan

  • Bojan Radonic

    Hey again @Christian,

    This is exactly why I offered a mu plugin solution. So it is not being easy to find and it's not inside the admin area. There is a line that you can comment out or remove but each time you update the parent theme it will be overwritten so you'll have to do it again.

    In case you want to do that anyway you'll find the line in functions.php which is located in /wp-content/themes/upfront/. The line you're looking for is in line 56 and it looks like this:

    add_action('admin_bar_menu', array($this, 'add_edit_menu'), 85);

    You can comment it or remove it and the button will be removed.

    Hope this helps :slight_smile:

    Best regards,
    Bojan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.