0

I just have a quick question... I am using the Advanced Custom Fields plugin on a site for a costumer, just to get a little more power into it.... but I wouldn't want the client to be poking around in there, and get all confused... is there an easy none-obtrusive way to sort of hide the options from the end user, bdut still keep the functionality around? I'm guessing a more generic google search would probably help me out, but it would be great to just get some feedback from u guys :)

-cheers kriwis

1

2 Answers 2

1

This looks like a very similar question. Take a look at @brasofilo's answer, you can modify for your own needs.

There are a couple of ways you could approach this: you could set up a custom role for your client's user accounts, giving them all the rights of an admin. Add a capability to the main admin role ($role = get_role("admin"); $role->add_cap("edit_acf_fields",)), then using these hooks to check for that role and deny access.

$current_user = get_current_user();

// If the user doesn't have the capability, no editing ACF settings.
if ( !$current_user->has_cap("edit_acf_fields") {
    // hide the menus
    // or kill the screens
}

The main reason to do this is portability. You (or the client) might want someone else to work on their site one day, they'll need their own account. More complex, but the recommended solution.

Alternatively, you can just check for your own email address and call it a day:

$current_user = get_current_user();

if ( $current_user->user_email == "[email protected]" ) {
    // hide the menus
    // or kill the screens
}

This is essentially invoking magic numbers, as an editing screen appears or disappears based on who you are, and there's no obvious explanation or way to change that behavior to the user. Easy, but Not Recommended.

1
  • thanks for the responses Much appreciated! I realize that i could have done a better job googling. To be honest this problem was yanking my chain to a insane degree, so I basically jumped the gun to ask, after not finding what i was looking for for a while.. thanks again for being so helpful, despite the fact that I kind of disregarded etiquette on this one. Won't happen again ;) (all too often) Commented Mar 22, 2013 at 7:34
1

Yes! There's the Advanced Custom Fields Lite plugin that gives you all options without any Menu.

You just need to export fields that you created using the normal ACF plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.