https://github.com/artsunique/hiding-acf-in-production-mode-with-bedrock-and-sage-by-roots.io
Hiding ACF in Production Mode with Bedrock and Sage by Roots.io
https://github.com/artsunique/hiding-acf-in-production-mode-with-bedrock-and-sage-by-roots.io
Last synced: 2 months ago
JSON representation
Hiding ACF in Production Mode with Bedrock and Sage by Roots.io
- Host: GitHub
- URL: https://github.com/artsunique/hiding-acf-in-production-mode-with-bedrock-and-sage-by-roots.io
- Owner: artsunique
- License: mit
- Created: 2024-07-29T07:21:14.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-07-29T07:29:24.000Z (10 months ago)
- Last Synced: 2025-01-20T03:56:26.803Z (4 months ago)
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hiding ACF in Production Mode with Bedrock and Sage by Roots.io
## Description:
This repository contains a code snippet for WordPress, specifically tailored for those using the Bedrock and Sage frameworks by Roots.io. The snippet removes the ACF menu from the admin sidebar and admin bar, and restricts direct access to ACF pages when in production mode. This is useful for securing custom field management and preventing changes in the production environment.
### Features:
• Removes the ACF menu from the admin sidebar in production mode.
• Removes the ACF menu from the admin bar in production mode.
• Blocks direct access to ACF pages in production mode.### Important Note:
This guide assumes you are using Bedrock and Sage by Roots.io, which leverages environment variables for configuration.### Usage:
#### 1. Add Environment Variable:
Ensure the WP_ENV environment variable is set to production in your .env file (commonly used with Bedrock):WP_ENV='production'
#### 2. Add Code Snippet:
Add the following code to your theme’s functions.php file (in Sage, this file is typically located in app/setup.php) or to a custom plugin.#WordPress #Advanced Custom Fields #ACF #Bedrock #Sage #Roots.io #Production Mode #WordPress Security #WordPress Customization #Environment Variables