Skip to content

Commit

Permalink
updated label
Browse files Browse the repository at this point in the history
  • Loading branch information
akashmdiu committed Dec 10, 2023
1 parent 8285505 commit 0a4fedd
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
35 changes: 32 additions & 3 deletions EmbedPress/Includes/Classes/Extend_Elementor_Controls.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,41 @@ public function extend_elementor_share_and_lock_controls($that, $infix = '', $pr
$that->add_control(
'adFileUrl',
[
'label' => __('Ad File URL', 'embedpress'),
'label' => __('Uploaded Video', 'embedpress'),
'type' => \Elementor\Controls_Manager::MEDIA,
'media_types' => [
'image', 'video'
'video'
],
'condition' => [
'adManager' => 'yes',
'adSource' => 'video',
],
'ai' => $ai_condition,
]
);
$that->add_control(
'adFileUrl1',
[
'label' => __('Uploaded Image', 'embedpress'),
'type' => \Elementor\Controls_Manager::MEDIA,
'media_types' => [
'image'
],
'condition' => [
'adManager' => 'yes',
'adSource' => 'image',
],
'ai' => $ai_condition,
]
);
$that->add_control(
'adFileUrl2',
[
'type' => \Elementor\Controls_Manager::URL,
'condition' => [
'adManager' => 'yes',
'adSource' => 'url',
],
'condition' => $ad_condition,
'ai' => $ai_condition,
]
);
Expand Down
11 changes: 10 additions & 1 deletion EmbedPress/Includes/Classes/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,16 @@ public static function generateAdTemplate($client_id, $attributes, $editor = 'el
$adContent = isset($attributes['adContent']) ? $attributes['adContent'] : '';

if ($editor === 'elementor') {
$adFileUrl = isset($attributes['adFileUrl']['url']) ? $attributes['adFileUrl']['url'] : '';
if($attributes['adSource'] === 'video'){
$adFileUrl = isset($attributes['adFileUrl']['url']) ? $attributes['adFileUrl']['url'] : '';
}
else if($attributes['adSource'] === 'image'){
$adFileUrl = isset($attributes['adFileUrl1']['url']) ? $attributes['adFileUrl1']['url'] : '';
}
else{
$adFileUrl = isset($attributes['adFileUrl2']['url']) ? $attributes['adFileUrl2']['url'] : '';
}

$width = isset($attributes['width']) ? $attributes['width']['size'] : '600';
$height = isset($attributes['height']) ? $attributes['height']['size'] : '550';
} else {
Expand Down

0 comments on commit 0a4fedd

Please sign in to comment.