---
name: wpnavigation
description: "Navigate the site structure and search pages."
---

# WordPress Navigation

Navigate the site structure and search pages.

## Functions

### `window._web_skills.wpnavigation.getsitemap(input)`

**Purpose:** Get the site navigation structure including menus and top-level pages.

**Input:**

```json
{
    "type": "object",
    "properties": []
}
```

**Output:**

```json
{
    "type": "object",
    "properties": {
        "menus": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "title": {
                                    "type": "string"
                                },
                                "url": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "pages": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    }
                }
            }
        }
    }
}
```

### `window._web_skills.wpnavigation.searchpages(input)`

**Purpose:** Search published pages by query.

**Input:**

```json
{
    "type": "object",
    "properties": {
        "query": {
            "type": "string",
            "description": "Search query"
        }
    },
    "required": [
        "query"
    ]
}
```

**Output:**

```json
{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "id": {
                "type": "integer"
            },
            "title": {
                "type": "string"
            },
            "url": {
                "type": "string"
            }
        }
    }
}
```

## Runtime

All functions are available on `window._web_skills.wpnavigation` and return Promises.

Metadata is available at `window._web_skills.wpnavigation._meta`.
