| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\Mcp\Abilities\Utils; |
| 4 |
|
| 5 |
use Elementor\Core\Base\Document; |
| 6 |
|
| 7 |
if ( ! defined( 'ABSPATH' ) ) { |
| 8 |
exit; |
| 9 |
} |
| 10 |
|
| 11 |
class Document_Preview_Url { |
| 12 |
|
| 13 |
public static function output_schema_property(): array { |
| 14 |
return [ |
| 15 |
'type' => 'string', |
| 16 |
'format' => 'uri', |
| 17 |
'description' => 'Human preview URL. Open in a browser while logged into WordPress as an editor; relies on session cookies, not preview_nonce.', |
| 18 |
]; |
| 19 |
} |
| 20 |
|
| 21 |
public static function for_document( Document $document ): string { |
| 22 |
return remove_query_arg( 'preview_nonce', $document->get_wp_preview_url() ); |
| 23 |
} |
| 24 |
} |
| 25 |
|