# extendify/3.2.2/app/Agent/Controllers/SiteNavigationController.php

Extendify, version 3.2.2. 38 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.2.2/code/app/Agent/Controllers/SiteNavigationController.php
- Raw: https://pluginprobe.com/plugins/extendify/3.2.2/raw/app/Agent/Controllers/SiteNavigationController.php
- Modified: 2026-10-01T15:30:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/3.2.2/code/app/Agent/Controllers/SiteNavigationController.php#L10-L20`.

```php
<?php

/**
 * Site Navigation Controller
 */

namespace Extendify\Agent\Controllers;

/**
 * Site Navigation Controller
 */
class SiteNavigationController
{
    /**
     * Get a list of published navigation items from the site.
     *
     * @param \WP_REST_Request $request The REST API request
     * @return \WP_REST_Response.
     */
    public static function getSiteNavigation($request): \WP_REST_Response
    {
        $navigation = get_posts([
            'numberposts' => -1,
            'post_status' => 'publish',
            'post_type' => 'wp_navigation',
            'include' => $request->get_param('only') ? explode(',', $request->get_param('only')) : []
        ]);

        return new \WP_REST_Response(array_map(function ($item) {
            return [
                "id" => $item->ID,
                "name" => $item->post_title,
                "content" => $item->post_content
            ];
        }, $navigation), 200);
    }
}

```
