Skip to content

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

IDFeatureStatus
FRS-USERS-005Staff Directory🔜 Planned
FRS-USERS-006Intranet Profile🔜 Planned
FRS-USERS-007Network-Wide Bookmarks🔜 Planned

Staff Directory

Search and browse company directory with filtering by department, role, and more.

REST Endpoints

MethodEndpointDescription
GET/frs-users/v1/intranet/directorySearch directory
GET/frs-users/v1/intranet/departmentsList departments

Query Parameters

ParamTypeDescription
searchstringSearch name, title, department
departmentstringFilter by department
rolestringFilter by role
per_pageintResults per page (default: 20)
pageintPage 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

MethodEndpointDescription
GET/frs-users/v1/intranet/org-chartFull 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

FieldMeta KeyDescription
Reports Tofrs_intranet_reports_toUser ID of manager
Departmentfrs_intranet_departmentDepartment name

Intranet Profile

Separate internal-facing profile from consumer-facing profile.

REST Endpoints

MethodEndpointDescription
GET/frs-users/v1/intranet/profile/{id}Get intranet profile
PUT/frs-users/v1/intranet/profile/{id}Update intranet profile

Profile Fields

FieldMeta KeyDescription
Departmentfrs_intranet_departmentDepartment name
Reports Tofrs_intranet_reports_toManager user ID
Office Locationfrs_intranet_office_locationOffice/building
Extensionfrs_intranet_extensionPhone extension
Start Datefrs_intranet_start_dateEmployment start
Internal Biofrs_intranet_bioInternal-only bio
Skillsfrs_intranet_skillsSkill tags (array)

Network-Wide Bookmarks

Save content from any site in the network, access everywhere.

REST Endpoints

MethodEndpointDescription
GET/frs-users/v1/intranet/bookmarksGet user's bookmarks
POST/frs-users/v1/intranet/bookmarksAdd bookmark
DELETE/frs-users/v1/intranet/bookmarks/{id}Remove bookmark
GET/frs-users/v1/intranet/collectionsGet collections
POST/frs-users/v1/intranet/collectionsCreate 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

AbilityDescription
frs-intranet/search-directorySearch staff directory
frs-intranet/get-org-chartGet organization hierarchy
frs-intranet/get-direct-reportsGet user's direct reports
frs-intranet/get-profileGet intranet profile
frs-intranet/update-profileUpdate intranet fields
frs-intranet/get-bookmarksGet user's bookmarks
frs-intranet/add-bookmarkAdd new bookmark
frs-intranet/remove-bookmarkRemove bookmark
frs-intranet/find-colleagueNatural 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 abilities

Hub21 Platform Documentation