Created
March 16, 2018 10:09
-
-
Save certainlyakey/1624210a41d7e77fb0b8f2e95fc5ef2e to your computer and use it in GitHub Desktop.
Add a hint on the media upload screen in admin (Wordpress)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function upload_hint() { | |
global $common_config; | |
$adminscreen = get_current_screen(); | |
echo '<p>'; | |
_e('Consider uploading images of at least 1050 pixels in width.','site'); | |
echo '</p>'; | |
// when featured images serve as logos | |
if ($adminscreen->id === 'post-type' && current_user_can('edit_users')) { | |
echo '<p>'; | |
_e('It is recommended to upload the logo in SVG format for better quality.','site'); | |
echo '</p>'; | |
} | |
if (!current_user_can('edit_users')) { | |
echo '<p>'; | |
echo $common_config->svg_role_error_label; | |
echo '</p>'; | |
} | |
} | |
add_action( 'post-upload-ui', 'upload_hint' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment