https://github.com/soranoo/wordpress-plugin-restrict-author-profile-access
A simple script to restrict others user access certaint author profile.
https://github.com/soranoo/wordpress-plugin-restrict-author-profile-access
wordpress wordpress-plugin
Last synced: 3 months ago
JSON representation
A simple script to restrict others user access certaint author profile.
- Host: GitHub
- URL: https://github.com/soranoo/wordpress-plugin-restrict-author-profile-access
- Owner: soranoo
- License: mit
- Created: 2023-12-14T18:25:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-16T16:17:40.000Z (over 2 years ago)
- Last Synced: 2025-10-26T10:21:31.150Z (8 months ago)
- Topics: wordpress, wordpress-plugin
- Language: PHP
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WordPress-Plugin-Restrict-Author-Profile-Access
[](LICENSE) [](https://github.com/soranoo/Donation)
A 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
1. Download the `restrict_author_profile_access.php` file from this repository.
2. Upload the file to your WordPress plugins directory, usually located at `wp-content/plugins/`.
3. Navigate to the Plugins section in your WordPress admin panel and activate the "Restrict Author Profile Access" plugin.
#### Method 2: Treat as Code Snippet
1. Copy the code from the `restrict_author_profile_access.php` file.
2. Navigate to the Code Snippets section in your WordPress admin panel.
3. Add a new code snippet and paste the code into the code editor.
4. Activate the code snippet.
## 📝 Usage
#### Setting Page
1. Navigate to the Settings section in your WordPress admin panel.
2. Click the "Restrict Author Profile Access" menu.
#### Add New Restricted Author
1. Select author(s) from the multi-select box.
2. Click the "Save Changes" button.
## 📖 API Reference
### Check if the author profile is restricted
```php
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
```php
$is_restricted_author = function_exists('wprapa_is_author_profile_restricted') ? wprapa_is_author_profile_restricted(get_the_author_meta('ID')) : false;
```
### Add restricted author
```php
wprapa_add_restricted_author($author_id) : void
```
| Parameter | Type | Description |
| :----------- | :---- | :---------- |
| `$author_id` | `int` | Author ID. |
### Remove restricted author
```php
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](LICENSE) file for details
## ☕ Donation
Love it? Consider a donation to support my work.
[](https://github.com/soranoo/Donation) <- click me~