-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
namespace HelloPlus\Modules\Theme\Classes; | ||
|
||
use Elementor\Control_Media; | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; // Exit if accessed directly | ||
} | ||
|
||
class Control_Media_Preview extends Control_Media { | ||
|
||
const CONTROL_TYPE = 'media-preview'; | ||
|
||
public function get_type() { | ||
return self::CONTROL_TYPE; | ||
} | ||
|
||
public function content_template() { | ||
?> | ||
<div class="elementor-control-field elementor-control-media"> | ||
<label class="elementor-control-title">{{{ data.label }}}</label> | ||
<div class="elementor-control-input-wrapper"> | ||
<div class="elementor-control-media-area"> | ||
<div class="elementor-control-media__preview" style="background-image: url('{{ data.src }}');"></div> | ||
</div> | ||
</div> | ||
<# if ( data.description ) { #> | ||
<div class="elementor-control-field-description">{{{ data.description }}}</div> | ||
<# } #> | ||
<input type="hidden" data-setting="{{ data.name }}"/> | ||
</div> | ||
<?php | ||
} | ||
|
||
} | ||