Server IP : 15.235.198.142 / Your IP : 216.73.216.10 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/yme/wp-content/plugins/elementor-pro/modules/screenshots/ |
Upload File : |
<?php namespace ElementorPro\Modules\Screenshots; use Elementor\Core\Frontend\RenderModes\Render_Mode_Base; use Elementor\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Render_Mode_Screenshot extends Render_Mode_Base { const ENQUEUE_SCRIPTS_PRIORITY = 1000; public static function get_name() { return 'screenshot'; } public function prepare_render() { parent::prepare_render(); show_admin_bar( false ); remove_filter( 'the_content', [ \ElementorPro\Modules\ThemeBuilder\Module::instance()->get_locations_manager(), 'builder_wrapper' ], 9999999 ); add_filter( 'template_include', [ $this, 'filter_template' ] ); } public function filter_template() { return ELEMENTOR_PATH . 'modules/page-templates/templates/canvas.php'; } public function is_static() { return true; } public function enqueue_scripts() { $suffix = ( Utils::is_script_debug() || Utils::is_elementor_tests() && ELEMENTOR_PRO_TESTS ) ? '' : '.min'; wp_enqueue_script( 'dom-to-image', ELEMENTOR_PRO_ASSETS_URL . "/lib/dom-to-image/js/dom-to-image{$suffix}.js", [], '2.6.0', true ); wp_enqueue_script( 'html2canvas', ELEMENTOR_PRO_ASSETS_URL . "/lib/html2canvas/js/html2canvas{$suffix}.js", [], '1.0.0-rc.5', true ); wp_enqueue_script( 'elementor-screenshot', ELEMENTOR_PRO_ASSETS_URL . "/js/screenshot{$suffix}.js", [ 'dom-to-image', 'html2canvas' ], ELEMENTOR_PRO_VERSION, true ); $config = [ 'selector' => '.elementor-' . $this->post_id, 'nonce' => wp_create_nonce( Module::SCREENSHOT_PROXY_NONCE_ACTION ), 'home_url' => home_url(), 'post_id' => $this->post_id, ]; wp_add_inline_script( 'elementor-screenshot', 'var ElementorScreenshotConfig = ' . wp_json_encode( $config ) . ';' ); } }