Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress - Filters to let your user know about image/PDF compression resources at the upload screens
<?php
/**
* Image and PDF compression resources message at upload screens.
*/
function upload_suggestions_message() { ?>
<h3>Uploading Files Guide</h3>
<p class="upload-html-bypass hide-if-no-js">Here are a few options to reduce the size of images/files before uploading them (please always do this to help load the site faster for visitors!!).</p>
<ul>
<li><a href="https://compressor.io/" target="_blank">Compressior.io - Compress all your images with this site.</a></li>
<li><a href="https://smallpdf.com/" target="_blank">SmallPDF.com - Compress those PDFs as well for clients or on page display.</a></li>
</ul>
<?php
}
add_action( 'post-plupload-upload-ui', 'upload_suggestions_message' );
add_action( 'post-html-upload-ui', 'upload_suggestions_message' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.