Support

Account

Home Forums Backend Issues (wp-admin) Disable "Edit Field Group" Shortcut from Posts

Solving

Disable "Edit Field Group" Shortcut from Posts

  • I think this feature was added recently, but if it has been around longer I have only just noticed.

    When a user is editing e.g. a page on the back-end, there is now a settings “cog” icon that appears in the field group on the page. When the user clicks this, it gives them direct access to edit the custom fields in that field group. This is highly undesirable for how my agency uses ACF Pro with clients, as the entire idea is for us to build the fields for them, and then hand off the shiny editing screens to the client without them being able to access the field internals.

    How can we disable the shortcut icon from appearing? I looked through the forums here and was surprised to see that no one else seems to be having trouble with this. This morning one of our clients panicked and deleted an entire field group because they didn’t know what they were doing. (Clients are sometimes like little children lol!)

  • I agree with the comment.

    The display of this is set by the user role and their access to the site.

    You can alter the permission to edit field groups by modifying the ACF capability setting https://www.advancedcustomfields.com/resources/acf-settings/

    Unfortunately, if your user is an admin this won’t do you much good.

    You can also hide the admin https://www.advancedcustomfields.com/resources/how-to-hide-acf-menu-from-clients/

  • Thanks for the quick reply John!

    Our sites do already have the admin menu hidden from clients (including the Admin role), however that doesn’t seem to prevent this particular issue.

    I’ll need to look into the ACF capability settings – I wasn’t aware of that feature. Thank you for the link!

  • The default setting might be edit_posts or something similar and you’ll need to change it.

  • @mtv.jcil did you succeed ?

  • Hi Beee, sorry for the late response. I was facing a limited deadline and project budget, so instead I opted with the client to train employees not to click the link. Not a real solution unfortunately :/

  • The option John linked to also hides the cogwheel. Isn’t that what you want ?

  • I had the same request as OP. I do also hide the menu sometimes, but I want to hide this in a different situation.

    I checked the source code and it looks like this button is added by a big chunk of JS. So there’s no hook to disable this particular feature.

    In this thread @PandS and @Jonathan found the alternative solution of using CSS to hide the cog. So that’s what I’m using now.

    <?php
    
    /**
     * Hide the ACF "Edit field group" cog in metaboxes.
     */
    
    add_action( 'acf/input/admin_head', function () {
    ?>
    <style>
    .acf-postbox > .hndle .acf-hndle-cog { display: none !important; }
    </style>
    <?php
    });
    
    
  • I would recommend using your option @brugman.
    Correct me if I’m wrong, but I can’t see an option where the filter is not sufficient…

  • I agree there should be an ACF Setting that allows admins to toggle OFF post box header field Quick link.

    This is the CSS I added to hide it for now:
    .acf-postbox .handle-actions .acf-hndle-cog {display: none !important;}

  • @mtv-jcil I would take suggestion of @brugman and maybe go 1 extra step (if my reasoning makes sense – see below).

    I would check for something unique about the logged in user, and if it is not a user you want to see the cog, I would add an extra CSS Class to the body tag. Why?

    This way… when doing the CSS to hide the cog, you can reference the body.(addclasshere) to the CSS Selector so that your agency users could still use it and just not other users.

    Yes, not really necessary, but it could make sense to shave some service time off (over time). As I do use the cog at times when needing to add/edit the field group to save on going through Admin Menu > Find Group > etc. Some bigger (or older) sites some times take me a bit long to find it going through the multi-step approach.

    Just my .02

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Disable "Edit Field Group" Shortcut from Posts’ is closed to new replies.