Restrict Author Profile Access
A simple script to restrict others user access certaint author profile.
by soranoo (Freeman) · github.com/soranoo/wordpress-plugin-restrict-author-profile-access
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/soranoo/wordpress-plugin-restrict-author-profile-access/archive/refs/heads/main.zipA simple script to restrict others user access certaint author profile.
This is my first WordPress plugin. I'm still learning how to write a good plugin. If you have any suggestion, please let me know. Thank you.
📷 Screenshot
[
]()
🚀 Installation
Method 1: Treat as Plugin
- Download the
restrict_author_profile_access.phpfile from this repository. - Upload the file to your WordPress plugins directory, usually located at
wp-content/plugins/. - Navigate to the Plugins section in your WordPress admin panel and activate the "Restrict Author Profile Access" plugin.
Method 2: Treat as Code Snippet
- Copy the code from the
restrict_author_profile_access.phpfile. - Navigate to the Code Snippets section in your WordPress admin panel.
- Add a new code snippet and paste the code into the code editor.
- Activate the code snippet.
📝 Usage
Setting Page
- Navigate to the Settings section in your WordPress admin panel.
- Click the "Restrict Author Profile Access" menu.
Add New Restricted Author
- Select author(s) from the multi-select box.
- Click the "Save Changes" button.
📖 API Reference
Check if the author profile is restricted
wprapa_is_author_profile_restricted($author_id) : bool
| Parameter | Type | Description |
|---|---|---|
$author_id |
int |
Author ID. |
Return
| Type | Description |
|---|---|
bool |
true if the author profile is restricted, false otherwise. |
Code Example
$is_restricted_author = function_exists('wprapa_is_author_profile_restricted') ? wprapa_is_author_profile_restricted(get_the_author_meta('ID')) : false;
Add restricted author
wprapa_add_restricted_author($author_id) : void
| Parameter | Type | Description |
|---|---|---|
$author_id |
int |
Author ID. |
Remove restricted author
wprapa_remove_restricted_author($author_id) : void
| Parameter | Type | Description |
|---|---|---|
$author_id |
int |
Author ID. |
🐛 Known Issues
- Waiting for your report.
⭐ TODO
- N/A
🤝 Contributing
Contributions are welcome! If you find a bug, please open an issue. If you want to contribute code, please fork the repository and submit a pull request.
📝 License
This project is licensed under the MIT License - see the LICENSE file for details
☕ Donation
Love it? Consider a donation to support my work.
