Intranet Module
Part of: frs-wp-users v2.2.0 Location: includes/Intranet/
The Intranet Module adds internal-facing features to frs-wp-users: staff directory, org chart, and network-wide bookmarks.
Features
| ID | Feature | Status |
|---|---|---|
| FRS-USERS-005 | Staff Directory | 🔜 Planned |
| FRS-USERS-006 | Intranet Profile | 🔜 Planned |
| FRS-USERS-007 | Network-Wide Bookmarks | 🔜 Planned |
Staff Directory
Search and browse company directory with filtering by department, role, and more.
REST Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /frs-users/v1/intranet/directory | Search directory |
| GET | /frs-users/v1/intranet/departments | List departments |
Query Parameters
| Param | Type | Description |
|---|---|---|
search | string | Search name, title, department |
department | string | Filter by department |
role | string | Filter by role |
per_page | int | Results per page (default: 20) |
page | int | Page number |
Example
bash
curl 'https://myhub21.com/wp-json/frs-users/v1/intranet/directory?department=Sales&per_page=10'Org Chart
Visual hierarchy with reporting relationships.
REST Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /frs-users/v1/intranet/org-chart | Full org tree |
| GET | /frs-users/v1/intranet/org-chart/{id} | Subtree from user |
| GET | /frs-users/v1/intranet/direct-reports/{id} | Direct reports only |
| GET | /frs-users/v1/intranet/reporting-chain/{id} | Chain to top |
Data Structure
json
{
"id": 1,
"name": "Jane Smith",
"title": "CEO",
"department": "Executive",
"avatar_url": "https://...",
"reports": [
{
"id": 2,
"name": "John Doe",
"title": "VP Sales",
"reports": [...]
}
]
}Profile Meta
| Field | Meta Key | Description |
|---|---|---|
| Reports To | frs_intranet_reports_to | User ID of manager |
| Department | frs_intranet_department | Department name |
Intranet Profile
Separate internal-facing profile from consumer-facing profile.
REST Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /frs-users/v1/intranet/profile/{id} | Get intranet profile |
| PUT | /frs-users/v1/intranet/profile/{id} | Update intranet profile |
Profile Fields
| Field | Meta Key | Description |
|---|---|---|
| Department | frs_intranet_department | Department name |
| Reports To | frs_intranet_reports_to | Manager user ID |
| Office Location | frs_intranet_office_location | Office/building |
| Extension | frs_intranet_extension | Phone extension |
| Start Date | frs_intranet_start_date | Employment start |
| Internal Bio | frs_intranet_bio | Internal-only bio |
| Skills | frs_intranet_skills | Skill tags (array) |
Network-Wide Bookmarks
Save content from any site in the network, access everywhere.
REST Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /frs-users/v1/intranet/bookmarks | Get user's bookmarks |
| POST | /frs-users/v1/intranet/bookmarks | Add bookmark |
| DELETE | /frs-users/v1/intranet/bookmarks/{id} | Remove bookmark |
| GET | /frs-users/v1/intranet/collections | Get collections |
| POST | /frs-users/v1/intranet/collections | Create collection |
Bookmark Structure
json
{
"id": 123,
"post_id": 456,
"site_id": 1,
"post_title": "Getting Started Guide",
"post_url": "https://myhub21.com/guides/getting-started",
"post_type": "post",
"collection": "Learning",
"created_at": "2026-01-25T10:30:00Z"
}Greenshift Integration
Bookmarks sync with Greenshift wishlist:
php
// User meta (Greenshift format)
_wished_posts = [123, 456, 789]
// Synced by Bookmarks class
\FRSUsers\Intranet\Bookmarks::sync_to_greenshift($user_id);Storage
Bookmarks stored in main site's usermeta for network-wide access:
php
// Always queries main site
switch_to_blog(get_main_site_id());
$bookmarks = get_user_meta($user_id, '_frs_bookmarks', true);
restore_current_blog();WordPress Abilities
Intranet Category
| Ability | Description |
|---|---|
frs-intranet/search-directory | Search staff directory |
frs-intranet/get-org-chart | Get organization hierarchy |
frs-intranet/get-direct-reports | Get user's direct reports |
frs-intranet/get-profile | Get intranet profile |
frs-intranet/update-profile | Update intranet fields |
frs-intranet/get-bookmarks | Get user's bookmarks |
frs-intranet/add-bookmark | Add new bookmark |
frs-intranet/remove-bookmark | Remove bookmark |
frs-intranet/find-colleague | Natural language colleague search |
Example AI Query
"Who reports to John Smith?"
→ frs-intranet/get-direct-reports { user_id: 42 }
"Find someone in the Marketing department"
→ frs-intranet/search-directory { department: "Marketing" }
"Show me the org chart"
→ frs-intranet/get-org-chart {}PHP Classes
IntranetProfile
php
use FRSUsers\Intranet\IntranetProfile;
// Get all intranet data for user
$profile = IntranetProfile::get_all($user_id);
// Get direct reports
$reports = IntranetProfile::get_direct_reports($user_id);
// Get reporting chain to top
$chain = IntranetProfile::get_reporting_chain($user_id);
// Get all departments
$departments = IntranetProfile::get_departments();Bookmarks
php
use FRSUsers\Intranet\Bookmarks;
// Add bookmark
Bookmarks::add_bookmark($user_id, $post_id, $site_id, 'Learning');
// Remove bookmark
Bookmarks::remove_bookmark($user_id, $bookmark_id);
// Get bookmarks with post data
$bookmarks = Bookmarks::get_bookmarks_with_posts($user_id);
// Sync to Greenshift wishlist
Bookmarks::sync_to_greenshift($user_id);File Structure
includes/Intranet/
├── IntranetProfile.php # Profile management
├── Bookmarks.php # Bookmark system
├── Routes.php # REST endpoints
└── IntranetAbilities.php # AI abilitiesRelated
- frs-wp-users - Main plugin documentation
- Intranet API - Full REST reference
- Intranet Abilities - AI integration