Skip to content

Commit 4399ef6

Browse files
committed
docs: update SCF installation guide with Composer integration, benefits, and optional admin menu and update notification hiding
docs: update SCF installation guide with Composer integration, benefits, and optional admin menu and update notification hiding
1 parent 21d3d35 commit 4399ef6

File tree

1 file changed

+57
-6
lines changed

1 file changed

+57
-6
lines changed

docs/welcome/installation.md

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,42 @@ Before installing, ensure your site meets these requirements:
2626
2. Extract the plugin files
2727
3. Upload the plugin folder to `/wp-content/plugins/`
2828
4. Activate through the WordPress admin interface
29+
---
2930

3031
### Composer Installation
3132

32-
This guide explains how to install and integrate the **Secure Custom Fields** plugin in your WordPress theme or plugin using Composer.
33+
To install and manage Secure Custom Fields in your WordPress theme or plugin, it is recommended to use Composer.
34+
35+
This ensures that SCF is properly versioned, loaded automatically, and easy to update.
36+
37+
### Why integrate **Secure Custom Fields (SCF)** with Composer?
38+
39+
Integrating SCF using Composer offers several important advantages for the professional development of WordPress plugins and themes:
40+
41+
- **Centralized dependency management:**
42+
Composer allows you to declare, install, and update SCF easily along with other libraries needed in your project.
43+
44+
- **Version control:**
45+
You can lock a specific version of SCF in your `composer.json`, ensuring that all development and production environments use exactly the same version, avoiding unexpected errors.
46+
47+
- **Simplified deployment and automation (CI/CD):**
48+
Composer installs SCF automatically during deployment processes (`composer install`), eliminating the need to manually copy files.
49+
50+
- **Automatic autoloading:**
51+
Composer handles PHP class autoloading. Integrating SCF this way makes your code cleaner, safer, and PSR-4 compliant.
52+
53+
- **Reduced repository size:**
54+
By installing SCF as an external dependency, you avoid having redundant copies of the plugin in your project, keeping your repository lighter and easier to maintain.
55+
56+
- **License compliance:**
57+
Composer records the licenses of all dependencies used, which is very useful if you distribute your plugins or themes and need to meet legal or auditing requirements.
58+
59+
- **Facilitates project changes:**
60+
By managing SCF as a dependency, any theme or plugin can change its structure or installation system without affecting its functionality, ensuring greater flexibility and compatibility in development.
61+
62+
---
63+
64+
### How to Load and Use **Secure Custom Fields (SCF)** with Composer
3365

3466
Add the following configuration to your `composer.json` file:
3567

@@ -87,7 +119,11 @@ if (! class_exists('ACF')) {
87119
### Done!
88120
You have successfully installed and integrated Secure Custom Fields via Composer. You can now use it as you would with a normal installation, but with all the benefits of Composer-based dependency management.
89121

90-
### Hide SCF Admin Menu and Updates
122+
---
123+
124+
### Optional: Hide SCF Admin Menu and Updates
125+
126+
If you want to hide the **Secure Custom Fields (SCF)** admin menu from the WordPress dashboard and prevent the plugin's update notifications from appearing, you can use the following code:
91127

92128
```php
93129
// Hide the SCF admin menu item.
@@ -96,11 +132,26 @@ add_filter( 'acf/settings/show_admin', '__return_false' );
96132
// Hide the SCF Updates menu.
97133
add_filter( 'acf/settings/show_updates', '__return_false', 100 );
98134
```
135+
#### What does this do?
136+
137+
- **Hide Admin Menu:**
138+
The first filter disables the SCF menu in the WordPress admin area, preventing users from accessing SCF field groups or settings.
139+
140+
- **Hide Update Notifications:**
141+
The second filter disables the SCF update notices, so users won't see update prompts for the plugin inside the admin dashboard.
142+
143+
#### When should you use it?
144+
145+
- If you are bundling SCF inside your plugin or theme and want to **control all the custom fields yourself** without allowing clients or users to modify them.
146+
- If you want to **maintain full control** over SCF versions and updates to avoid compatibility issues caused by manual updates.
147+
148+
> **Note:** Hiding updates means you are responsible for manually updating SCF when necessary to keep your project secure and compatible.
149+
99150

100-
## Verification
151+
## Verify Your Installation
101152

102153
After installation:
103154

104-
1. Navigate to Custom Fields in your admin menu
105-
2. Verify you can access all plugin features
106-
3. Create a test field group to ensure functionality
155+
1. Navigate to **Secure Custom Fields** in your WordPress admin menu.
156+
2. Verify that you can access all **Secure Custom Fields** plugin features.
157+
3. Create a **test field group** to ensure that fields are saved and displayed correctly.

0 commit comments

Comments
 (0)