| Server IP : 172.67.133.75 / Your IP : 104.23.197.160 Web Server : nginx/1.26.1 System : Linux HE9229 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 User : www ( 1000) PHP Version : 8.0.26 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/jl3_ph_com/wp-content/plugins/elementor-pro/modules/library/widgets/ |
Upload File : |
<?php
namespace ElementorPro\Modules\Library\Widgets;
use Elementor\Core\Base\Document;
use ElementorPro\Base\Base_Widget;
use ElementorPro\Modules\QueryControl\Module as QueryControlModule;
use ElementorPro\Plugin;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Template extends Base_Widget {
public function get_name() {
return 'template';
}
public function get_title() {
return esc_html__( 'Template', 'elementor-pro' );
}
public function get_icon() {
return 'eicon-document-file';
}
public function get_keywords() {
return [ 'elementor', 'template', 'library', 'block', 'page' ];
}
public function is_reload_preview_required() {
return false;
}
/**
* @since 3.6.0
*
* @deprecated 3.8.0
* On_Import_Trait::on_import_update_dynamic_content() should be used instead.
* Remove in the future.
*/
public static function on_import_replace_dynamic_content( $config, $map_old_new_post_ids ) {
if ( isset( $config['settings']['template_id'] ) ) {
$config['settings']['template_id'] = $map_old_new_post_ids[ $config['settings']['template_id'] ];
}
return $config;
}
protected function register_controls() {
$this->start_controls_section(
'section_template',
[
'label' => esc_html__( 'Template', 'elementor-pro' ),
]
);
$document_types = Plugin::elementor()->documents->get_document_types( [
'show_in_library' => true,
] );
$this->add_control(
'template_id',
[
'label' => esc_html__( 'Choose Template', 'elementor-pro' ),
'type' => QueryControlModule::QUERY_CONTROL_ID,
'label_block' => true,
'autocomplete' => [
'object' => QueryControlModule::QUERY_OBJECT_LIBRARY_TEMPLATE,
'query' => [
'meta_query' => [
[
'key' => Document::TYPE_META_KEY,
'value' => array_keys( $document_types ),
'compare' => 'IN',
],
],
],
],
]
);
$this->end_controls_section();
}
protected function render() {
$template_id = $this->get_settings( 'template_id' );
if ( empty( $template_id ) ) {
return;
}
if ( 'publish' !== get_post_status( $template_id ) ) {
return;
}
?>
<div class="elementor-template">
<?php
// PHPCS - should not be escaped.
echo Plugin::elementor()->frontend->get_builder_content_for_display( $template_id ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</div>
<?php
}
public function render_plain_content() {}
}