You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/welcome/installation.md
+57-6Lines changed: 57 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -26,10 +26,42 @@ Before installing, ensure your site meets these requirements:
26
26
2. Extract the plugin files
27
27
3. Upload the plugin folder to `/wp-content/plugins/`
28
28
4. Activate through the WordPress admin interface
29
+
---
29
30
30
31
### Composer Installation
31
32
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
33
65
34
66
Add the following configuration to your `composer.json` file:
35
67
@@ -87,7 +119,11 @@ if (! class_exists('ACF')) {
87
119
### Done!
88
120
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.
89
121
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:
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
+
99
150
100
-
## Verification
151
+
## Verify Your Installation
101
152
102
153
After installation:
103
154
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