| Server IP : 3.93.235.159 / Your IP : 216.73.216.140 Web Server : Apache System : Linux ip-172-26-0-169 5.10.0-46-cloud-amd64 #1 SMP Debian 5.10.262-1 (2026-07-31) x86_64 User : bitnami ( 1000) PHP Version : 8.2.9 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/hello-plus/modules/template-parts/classes/runners/ |
Upload File : |
<?php
namespace HelloPlus\Modules\TemplateParts\Classes\Runners;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
use Elementor\App\Modules\ImportExport\Runners\Export\Export_Runner_Base;
use Elementor\Core\Base\Document;
use Elementor\TemplateLibrary\Source_Local;
use HelloPlus\Includes\Utils;
class Export extends Export_Runner_Base {
public static function get_name(): string {
return 'templates';
}
public function should_export( array $data ) {
return (
isset( $data['include'] ) &&
in_array( 'templates', $data['include'], true )
);
}
public function export( array $data ) {
$template_types = array_values( Source_Local::get_template_types() );
$query_args = [
'post_type' => Source_Local::CPT,
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_query' => [
[
'key' => Document::TYPE_META_KEY,
'value' => $template_types,
],
],
];
$templates_query = new \WP_Query( $query_args );
$templates_manifest_data = [];
$files = [];
foreach ( $templates_query->posts as $template_post ) {
$template_id = $template_post->ID;
$template_document = Utils::elementor()->documents->get( $template_id );
$templates_manifest_data[ $template_id ] = $template_document->get_export_summary();
$files[] = [
'path' => 'templates/' . $template_id,
'data' => $template_document->get_export_data(),
];
}
$manifest_data['templates'] = $templates_manifest_data;
return [
'files' => $files,
'manifest' => [
$manifest_data,
],
];
}
}