Edit product
/*--------- Custom Invoice Logo Javascript ----------*/ jQuery(document).ready(function ($) {
jQuery(document).on("click", "#wpifw_upload_logo_button", function (e) { e.preventDefault(); var $button = $(this);
// Create the media frame. var file_frame = wp.media.frames.file_frame = wp.media({ title: 'Select or upload image', library: { // remove these to show all type: 'image' // specific mime }, button: { text: 'Select' }, multiple: false // Set to true to allow multiple files to be selected });
// When an image is selected, run a callback. file_frame.on('select', function () { // We set multiple to false so only get one image from the uploader
var attachment = file_frame.state().get('selection').first().toJSON();
$('#wpifw_logo-preview').attr('src', attachment.url).css('width', 'auto'); $('#wpifw_logo_attachment_id').val(attachment.id);
$button.siblings('input').val(attachment.id).change();
});
// Finally, open the modal file_frame.open(); }); });
/*--------- Custom Stamp Javascript ----------*/ jQuery(document).ready(function ($) {
jQuery(document).on("click", "#wpifw_upload_custom_stamp_button", function (e) { e.preventDefault(); var $button = $(this);
// Create the media frame. var file_frame = wp.media.frames.file_frame = wp.media({ title: 'Select or upload image', library: { // remove these to show all type: 'image' // specific mime }, button: { text: 'Select' }, multiple: false // Set to true to allow multiple files to be selected });
// When an image is selected, run a callback. file_frame.on('select', function () { // We set multiple to false so only get one image from the uploader
var attachment = file_frame.state().get('selection').first().toJSON();
$('#wpifw_custom_stamp_preview').attr('src', attachment.url); $('#wpifw_custom_stamp_attachment_id').val(attachment.id); $button.siblings('input').val(attachment.id).change();
});
// Finally, open the modal file_frame.open(); }); });
/*--------- Signature Javascript ----------*/ jQuery(document).ready(function ($) {
jQuery(document).on("click", "#wpifw_upload_signature_button", function (e) { e.preventDefault(); var $button = $(this);
// Create the media frame. var file_frame = wp.media.frames.file_frame = wp.media({ title: 'Select or upload image', library: { // remove these to show all type: 'image' // specific mime }, button: { text: 'Select' }, multiple: false // Set to true to allow multiple files to be selected });
// When an image is selected, run a callback. file_frame.on('select', function () { // We set multiple to false so only get one image from the uploader
var attachment = file_frame.state().get('selection').first().toJSON();
$('#wpifw_signature-preview').attr('src', attachment.url); $('#wpifw_signature_attachment_id').val(attachment.id); $button.siblings('input').val(attachment.id).change();
});
// Finally, open the modal file_frame.open(); }); });
/*------------- Custom Background Javascript ----------*/ jQuery(document).ready(function ($) {
jQuery(document).on("click", "#wpifw_upload_invoice_background_button", function (e) { e.preventDefault(); var $button = $(this);
// Create the media frame. var file_frame = wp.media.frames.file_frame = wp.media({ title: 'Select or upload image', library: { // remove these to show all type: 'image' // specific mime }, button: { text: 'Select' }, multiple: false // Set to true to allow multiple files to be selected });
// When an image is selected, run a callback. file_frame.on('select', function () { // We set multiple to false so only get one image from the uploader
var attachment = file_frame.state().get('selection').first().toJSON();
$('#wpifw_invoice-background-preview').attr('src', attachment.url); $('#wpifw_invoice_background_attachment_id').val(attachment.id);
$button.siblings('input').val(attachment.id).change();
});
// Finally, open the modal file_frame.open(); }); });
/*------------- Upload Static file Javascript ----------*/ jQuery(document).ready(function ($) {
$(".wpifw_static_files_section .wpifw_static_files").each(function (index) { jQuery(document).on("click", "#wpifw_upload_static_files_" + index + "_button", function (e) { e.preventDefault(); var $button = $(this);
// Create the media frame. var file_frame = wp.media.frames.file_frame = wp.media({ title: 'Select or upload image', /*library: { // remove these to show all type: 'application/pdf' // specific mime },*/ button: { text: 'Select' }, multiple: false // Set to true to allow multiple files to be selected });
// When an image is selected, run a callback. file_frame.on('select', function () { // We set multiple to false so only get one image from the uploader
var attachment = file_frame.state().get('selection').first().toJSON();
$("input[name='wpifw_static_files_" + index + "']").val(attachment.url);
$button.siblings('#wpifw_static_files_' + index).val(attachment.url).change();
});
// Finally, open the modal file_frame.open(); }); });
});
/*------------ Upload Packing Slip Background Javascript ----------*/ jQuery(document).ready(function ($) {
jQuery(document).on("click", "#wpifw_upload_packingslip_background_button", function (e) { e.preventDefault(); var $button = $(this);
// Create the media frame. var file_frame = wp.media.frames.file_frame = wp.media({ title: 'Select or upload image', library: { // remove these to show all type: 'image' // specific mime }, button: { text: 'Select' }, multiple: false // Set to true to allow multiple files to be selected });
// When an image is selected, run a callback. file_frame.on('select', function () { // We set multiple to false so only get one image from the uploader
var attachment = file_frame.state().get('selection').first().toJSON();
$('#wpifw_packingslip-background-preview').attr('src', attachment.url).css('width', 'auto'); $('#wpifw_packingslip_background_attachment_id').val(attachment.id);
$button.siblings('input').val(attachment.id).change();
});
// Finally, open the modal file_frame.open(); }); });
<# } #>
Actions
Selected media actions
Uploading
<# if ( data.buttons.check ) { #> <# } #> <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; if ( data.describe ) { if ( 'image' === data.type ) { #> <# } else { #> aria-label="Video title" placeholder="Video title…" <# } else if ( 'audio' === data.type ) { #> aria-label="Audio title" placeholder="Audio title…" <# } else { #> aria-label="Media title" placeholder="Media title…" <# } #> {{ maybeReadOnly }} /> <# } } #>
Attachment Details Saved.
<# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> <# if ( 'image' === data.type ) { #>
Learn how to describe the purpose of the image (opens in a new tab). Leave empty if the image is purely decorative.
<# } #> <# if ( 'audio' === data.type ) { #> <# } #>
Attachment Display Settings
<# if ( 'image' === data.type ) { #> <# } #>
<# if ( data.model.canEmbed ) { #><# if ( 'image' === data.type ) { #><# } #>
<# if ( 'undefined' !== typeof data.sizes ) { #> <# } #>
Gallery Settings
Playlist Settings
<# var emptyModel = _.isEmpty( data.model ), isVideo = 'video' === data.controller.get('library').props.get('type'); #>
checked="checked" <# } #> />
<# if ( ! isVideo ) { #> checked="checked" <# } #> /> <# } #>
checked="checked" <# } #> />
Learn how to describe the purpose of the image (opens in a new tab). Leave empty if the image is purely decorative.
Preview
As a browser icon
As an app icon
-
<# if ( data.options ) { #>
<# _.each( data.options, function( option ) { #>
- Delete Option
- Delete Option
- Delete Option
- Delete Option
- Add new option...
<# }); #> <# } else { #>
<# } #>
Contact form information
Contact form fields
Session expired
Please log in again. The login page will open in a new tab. After logging in you can close it and return to this page.