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
{{ message }}
This repository was archived by the owner on Jan 9, 2024. It is now read-only.
Out of the box, this package does absolutely nothing as all values are defaulted to false. To get started, begin passing your values through the provided filters. When passing the password, you must either pass it through `password_hash()` or if using ACF, use my [acf-encrypted-password](https://github.com/log1x/acf-encrypted-password) field.
23
+
Out of the box, this package does absolutely nothing as all values are defaulted to false. To get started, begin passing your values in an array through the provided filter. When passing the password, you must either pass it through `password_hash()` or if using ACF, use my [acf-encrypted-password](https://github.com/log1x/acf-encrypted-password) field.
24
24
25
-
Below are not only the provided filters, but a personal example of how I use them alongside ACF and [ACF Fluent](https://github.com/samrap/acf-fluent).
25
+
### Configuration
26
26
27
-
###Filters
27
+
#### Defaults
28
28
29
-
```php
30
-
/**
31
-
* Returns true if password protection is enabled.
32
-
*
33
-
* @return boolean
34
-
*/
35
-
add_filter('password-protected/isActive', function () {
36
-
return Acf::option('password_protected')->get();
37
-
});
38
-
39
-
/**
40
-
* Returns the password set for password protection.
41
-
*
42
-
* @return string
43
-
*/
44
-
add_filter('password-protected/password', function () {
45
-
return Acf::option('password')->get();
46
-
});
47
-
48
-
/**
49
-
* Returns true if feeds are allowed while password protection is enabled.
50
-
*
51
-
* @return boolean
52
-
*/
53
-
add_filter('password-protected/allowFeeds', function () {
54
-
return Acf::option('password_show_feeds')->get();
55
-
});
56
-
57
-
/**
58
-
* Returns true if admins are allowed to bypass authentication while password protection is enabled.
59
-
*
60
-
* @return boolean
61
-
*/
62
-
add_filter('password-protected/allowAdmins', function () {
0 commit comments