Skip to main content

Dependency

Vasyl MartyniukLess than 1 minute

Syntax

{
    "dependency-slug": "string"
}

Definition

While the policy defines the access rules, there has to be a code that supports it. That is why a policy can declare the list of minimum required plugins and WordPress core versions in the Dependency section. Typically you find dependencies like wordpress or advanced-access-manager with the minimum required version.

{
    "Dependency": {
        "wordpress": ">=5.8",
        "advanced-access-manager": ">=6.9.0"
    }
}

You will get a visual error notification on the policy edit screen if one or more dependencies do not satisfy the minimum required version. However, this does not necessarily mean the policy will not work properly. You would have to run additional tests to verify it.

AAM Access Policy Dependency Error

Version definition uses semantic versioning guidelinesopen in new window, and to make it consistent, AAM adopts the NPM manages dependencyopen in new window versioning syntax.

AAM 6.2.0+ allows defining extended details about depending plugin. There are no constraints as to how many attributes are provided. However, the Version is required.

{
    "Dependency": {
        "wordpress": ">=6.0.0",
        "advanced-access-manager": ">=6.2.0",
        "aam-complete-package": {
            "Version": ">=6.0.0",
            "Name": "AAM Complete Package",
            "URL": "https://aamportal.com/premium"
        }
    }
}

If the dependency definition contains a valid URL attribute, AAM renders the error message with the link to the defined location.

AAM Policy Dependency Error with Link

Virtual Assistant