Skip to main content

WP_SITE

Vasyl MartyniukLess than 1 minute

Syntax

${WP_SITE.<property>}

Definition

Get any property of the currently viewed blog. This marker use's WordPress core function get_blog_detailsopen in new window to obtain an instance of WP_Siteopen in new window that holds all the necessary information about a blog.

In the example below, we are going to restrict access to any subsite whose pathname starts with site.

{
    "Statement": [
        {
            "Effect": "deny",
            "Resource": "Site:${WP_SITE.blog_id}",
            "Condition": {
                "Like": {
                    "${CALLBACK.path}": "/site*"
                }
            }
        }
    ]
}