| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package SheetsPilot |
| 4 |
* @author Unlimited Elements |
| 5 |
* @copyright (C) 2026 Unlimited Elements, All Rights Reserved. |
| 6 |
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html |
| 7 |
**/ |
| 8 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 9 |
if (!defined("SHEETSPILOT_INC")) die("restricted access"); |
| 10 |
|
| 11 |
class SheetsPilotFrontProcessing |
| 12 |
{ |
| 13 |
function __construct(){ |
| 14 |
add_action('template_redirect', function(){ |
| 15 |
if( isset( $_GET['post_preview'] ) && isset( $_GET['nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['nonce'] ) ), 'sheetspilot_actions' ) ){ |
| 16 |
wp_redirect( get_preview_post_link( (int)$_GET['post_preview'] ), 302 ); |
| 17 |
die(); |
| 18 |
} |
| 19 |
}); |
| 20 |
|
| 21 |
} |
| 22 |
|
| 23 |
} |
| 24 |
new SheetsPilotFrontProcessing(); |
| 25 |
|