# elementor/3.31.2/modules/site-navigation/data/endpoints/homepage.php

Elementor Website Builder – more than just a page builder, version 3.31.2. 32 lines.

- Page: https://pluginprobe.com/plugins/elementor/3.31.2/code/modules/site-navigation/data/endpoints/homepage.php
- Raw: https://pluginprobe.com/plugins/elementor/3.31.2/raw/modules/site-navigation/data/endpoints/homepage.php
- Modified: 2024-02-29T11:51:58+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/elementor/3.31.2/code/modules/site-navigation/data/endpoints/homepage.php#L10-L20`.

```php
<?php

namespace Elementor\Modules\SiteNavigation\Data\Endpoints;

use Elementor\Data\V2\Base\Endpoint;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class Homepage extends Endpoint {

	public function get_permission_callback( $request ) {
		return current_user_can( 'edit_posts' );
	}

	public function get_name() {
		return 'homepage';
	}

	public function get_format() {
		return 'site-navigation/homepage';
	}

	public function get_items( $request ) {
		$homepage_id = get_option( 'page_on_front' );
		$show_on_front = get_option( 'show_on_front' );

		return 'page' === $show_on_front ? intval( $homepage_id ) : 0;
	}
}

```
