Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-forms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-forms
Commits
1f5e71bc
Commit
1f5e71bc
authored
3 years ago
by
potreb
Browse files
Options
Downloads
Patches
Plain Diff
fix: image input js fix
parent
5f808c48
No related branches found
No related tags found
1 merge request
!26
Devel
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/input-image.php
+8
-8
8 additions, 8 deletions
templates/input-image.php
with
8 additions
and
8 deletions
templates/input-image.php
+
8
−
8
View file @
1f5e71bc
...
...
@@ -7,10 +7,10 @@
$media_container_id
=
'media_'
.
sanitize_key
(
$field
->
get_id
()
);
?>
<div
class=
"media-input-wrapper"
id=
"
<?php
echo
\
esc_attr
(
$media_container_id
);
?>
"
>
<div
class=
"media-input-wrapper"
id=
"
<?php
echo
esc_attr
(
$media_container_id
);
?>
"
>
<input
type=
"hidden"
class=
"image-field-value"
value=
"
<?php
echo
\esc_html
(
$value
);
?>
"
name=
"
<?php
echo
\
esc_attr
(
$name_prefix
)
.
'['
.
\
esc_attr
(
$field
->
get_name
()
)
.
']'
;
?>
"
id=
"
<?php
echo
\
esc_attr
(
$field
->
get_id
()
);
?>
"
/>
name=
"
<?php
echo
esc_attr
(
$name_prefix
)
.
'['
.
esc_attr
(
$field
->
get_name
()
)
.
']'
;
?>
"
id=
"
<?php
echo
esc_attr
(
$field
->
get_id
()
);
?>
"
/>
<div
class=
"custom-img-container"
>
<?php
if
(
$value
)
:
?>
<img
src=
"
<?php
echo
\esc_url
(
$value
);
?>
"
alt=
""
width=
"100"
/>
...
...
@@ -22,21 +22,21 @@ $media_container_id = 'media_' . sanitize_key( $field->get_id() );
if
(
$value
)
:
?>
hidden
<?php
endif
?>
"
href=
"
<?php
echo
\esc_url
(
$value
);
?>
"
>
<?php
\
esc_html_e
(
'Set image'
,
'wp-forms'
);
?>
<?php
esc_html_e
(
'Set image'
,
'wp-forms'
);
?>
</a>
<a
class=
"delete-custom-img
<?php
if
(
!
$value
)
:
?>
hidden
<?php
endif
?>
"
href=
"#"
>
<?php
\
esc_html_e
(
'Remove image'
,
'wp-forms'
);
?>
<?php
esc_html_e
(
'Remove image'
,
'wp-forms'
);
?>
</a>
</p>
</div>
<script>
jQuery
(
function
(
$
)
{
var
frame
,
metaBox
=
$
(
'
#
<?php
echo
\
esc_attr
(
$media_container_id
);
?>
'
),
metaBox
=
$
(
'
#
<?php
echo
esc_attr
(
$media_container_id
);
?>
'
),
addImgLink
=
metaBox
.
find
(
'
.upload-custom-img
'
),
delImgLink
=
metaBox
.
find
(
'
.delete-custom-img
'
),
imgContainer
=
metaBox
.
find
(
'
.custom-img-container
'
),
...
...
@@ -50,9 +50,9 @@ $media_container_id = 'media_' . sanitize_key( $field->get_id() );
}
frame
=
wp
.
media
(
{
title
:
<?php
esc_html_e
(
'Select or Upload Media'
,
'wp-forms'
);
?>
,
title
:
"
<?php
esc_html_e
(
'Select or Upload Media'
,
'wp-forms'
);
?>
"
,
button
:
{
text
:
<?php
esc_html_e
(
'Use this media'
,
'wp-forms'
);
?>
text
:
"
<?php
esc_html_e
(
'Use this media'
,
'wp-forms'
);
?>
"
},
library
:
{
type
:
[
'
image
'
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment