Skip to content

Instantly share code, notes, and snippets.

@mae829
Last active September 10, 2020 23:57
Show Gist options
  • Save mae829/7c60db2c1aa62b34ec563d98f4031619 to your computer and use it in GitHub Desktop.
Save mae829/7c60db2c1aa62b34ec563d98f4031619 to your computer and use it in GitHub Desktop.
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