Home › Forums › General Issues › Hide admin menu on production but still show it on local › Reply To: Hide admin menu on production but still show it on local
Hi @satrya
You can check if the current user is accessing the server locally or remotely. This thread should give you more idea about it: http://stackoverflow.com/questions/6626204/how-to-check-if-the-php-script-is-running-on-a-local-server
So, you can use a code like this:
if($_SERVER['REMOTE_ADDR']!='127.0.0.1'){
add_filter('acf/settings/show_admin', '__return_false');
}
I hope this helps.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.