Framework Objects
Services are the main API for application code. The framework also exposes lower-level objects for extensions.
Resources
An access level’s get_resource($type, $reload = null) returns a resource object. Resources hold permissions for a resource type, such as posts, URLs, capabilities, menus, and MCP components. The corresponding service validates identifiers and supplies task-focused methods.
The registered resource types cover URLs and API routes; posts, terms, post types, and taxonomies; users, roles, and capabilities; backend menus, toolbar nodes, metaboxes, and widgets; hooks and policies; and abilities plus MCP servers, tools, prompts, and resources. Each has a matching service in the service index, except that policy and hook resources are accessed through their dedicated services.
$role = AAM::api()->role('editor');
$post_resource = $role->get_resource(AAM_Framework_Type_Resource::POST);
Prefer $role->posts() for a normal read or write. A resource object is useful when adding a framework integration or inspecting its permission model.
Preferences
get_preference($type, $reload = null) returns a preference object for values such as login, logout, not-found, and access-denied redirects. Use the redirect service for normal code so configuration is validated and inheritance is handled consistently.
The four named preference types are login redirect, logout redirect, not found redirect, and access denied redirect. Other preference types use the generic preference object when an extension registers them.
Proxies
User and role access levels wrap the underlying WP_User or WP_Role in an AAM proxy. get_proxy_instance() returns that proxy. Access-level get_id() and get_display_name() provide stable framework-facing values without depending on proxy details.
Utilities
The gateway also exposes utilities through properties such as AAM::api()->config, ->jwt, ->access_levels, and ->policy. They support framework internals and integrations. Services are the stable entry point for ordinary rules. See the relevant service page before using a utility directly.
| Utility group | Gateway properties |
|---|---|
| Data and caching | db, cache, object_cache |
| Identities and permissions | access_levels, users, roles, capabilities (alias caps) |
| Integrations | config, content, rest, redirect, jwt, policy, misc |
Caching and errors
Resources and preferences are cached per access level. Pass true as the second argument to get_resource() or get_preference() when an extension must reload an object. Services use the gateway’s error_handling setting; check for WP_Error if your application configures error returns.