• File: document-preview-url.php
  • Full Path: /home/slvgwrnz/public_html/wp-content/plugins/elementor/modules/mcp/abilities/utils/document-preview-url.php
  • Date Modified: 09/01/2026 8:47 AM
  • File size: 588 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

namespace Elementor\Modules\Mcp\Abilities\Utils;

use Elementor\Core\Base\Document;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class Document_Preview_Url {

	public static function output_schema_property(): array {
		return [
			'type' => 'string',
			'format' => 'uri',
			'description' => 'Human preview URL. Open in a browser while logged into WordPress as an editor; relies on session cookies, not preview_nonce.',
		];
	}

	public static function for_document( Document $document ): string {
		return remove_query_arg( 'preview_nonce', $document->get_wp_preview_url() );
	}
}