# Developer docs

Extend Link Manager Pro with WP-CLI, hooks and the REST API, and see where it stores its data.
Page: https://docs.linkmanagerpro.com/developers/
Use when someone asks: link manager pro developer docs; link manager pro api; extend link manager pro; link manager pro for developers
Intent: Navigational

The developer docs cover the four ways to extend Link Manager Pro and the data it keeps. Each area has its own pages with exact names, defaults and examples.

You can also use them as a site owner. When a developer sends you a snippet, find its hook, route or command here and read the plain sentence at the top of its entry.

## The four areas

### WP-CLI

Run the plugin from a shell, a script or a cron job. Every command with its options and defaults is in one reference.

- [WP-CLI for developers](https://docs.linkmanagerpro.com/developers/cli): scripting rules, every command with its options, backup export and restore, prefix moves and database commands.
- [WP-CLI commands](https://docs.linkmanagerpro.com/guides/wp-cli): the task guide for the everyday commands.

### Hooks

Run your own code when something happens in the plugin, or change what it does. Actions let you react; filters let you change a value.

- [Hooks overview](https://docs.linkmanagerpro.com/developers/hooks/): how to use them and an index of every hook.
- [Action hooks](https://docs.linkmanagerpro.com/developers/hooks/actions): events such as a click, and plugin lifecycle actions.
- [Filter hooks](https://docs.linkmanagerpro.com/developers/hooks/filters): defaults and allowed ranges for each filter.
- [Events, webhooks and AutomatorWP](https://docs.linkmanagerpro.com/developers/hooks/events): event payloads and how to verify a webhook signature.

### REST API

Read and change short links and other data over HTTP. The base URL is `https://example.com/wp-json/link-manager-pro/v1`.

- [REST API overview](https://docs.linkmanagerpro.com/developers/rest-api/): authentication, permissions, request and response format.
- [Short links endpoints](https://docs.linkmanagerpro.com/developers/rest-api/links): list, create, update and delete short links, with `curl` examples.
- [All endpoints](https://docs.linkmanagerpro.com/developers/rest-api/endpoints): every route, each linked to its full entry with parameters and response fields.

### Database

See where settings, links, clicks and options live, and what the backup file holds.

- [Where Link Manager Pro stores data](https://docs.linkmanagerpro.com/developers/data/): tables, options, scheduled tasks and what uninstall removes.
- [Database tables](https://docs.linkmanagerpro.com/developers/data/tables): columns and indexes of each table.
- [Backup file format](https://docs.linkmanagerpro.com/developers/data/backup-format): the JSON structure of a backup.

## Before you start

The plugin needs WordPress 6.0 or later and PHP 8.0 or later. Both come from the plugin header.

Put your custom code in your own small plugin or a must-use plugin. An update replaces the plugin's files, so changes made inside the plugin folder are lost.

Settings that switch something on or off are stored as the strings `yes` and `no`, not as `true` and `false`. Compare against `'yes'` in your code.

Read settings through the plugin, not by SQL: the settings are stored as JSON rows that the plugin reads and decodes for you. `LinkManagerPro\Services\Settings::get()` takes a `group.key` name and an optional default.

```php
if ( class_exists( 'LinkManagerPro\Services\Settings' ) ) {
	$days = (int) \LinkManagerPro\Services\Settings::get( 'tracking.click_retention_days', 0 );
}
```

Call it after the plugins have loaded, for example from a callback on `init`.

## Quick reference

| Item | Value |
|---|---|
| REST namespace | `link-manager-pro/v1` |
| WP-CLI command | `wp link-manager-pro` |
| Hook prefix | `link_manager_pro_` (two filters use `link_manager_pro/`) |
| Table prefix | `{$wpdb->prefix}link_manager_pro_` |
| Text domain | `link-manager-pro` |
| Capability `manage_link_manager_pro` | A stored capability. Activation adds it to the administrator and editor roles, and deactivation removes it. The access rule setting can use it for people who aren't administrators. |
| Capability `link_manager_pro_access` | A virtual capability, worked out on each request and never stored. Administrators always have it. Others have it when they hold the capability the access rule names. |
| Requirements | WordPress 6.0 or later, PHP 8.0 or later |

The access rule is on the screen described in [Access for editors](https://docs.linkmanagerpro.com/guides/access).

## Related

- [WP-CLI commands](https://docs.linkmanagerpro.com/guides/wp-cli)
- [Webhooks and AutomatorWP](https://docs.linkmanagerpro.com/guides/webhooks-automation)
- [Access for editors](https://docs.linkmanagerpro.com/guides/access)
- [Back up and restore](https://docs.linkmanagerpro.com/guides/backup-restore)
