Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('admin_head-media-upload-popup','wpse_55240_required_alt_text');
- function wpse_55240_required_alt_text()
- {
- echo <<<HTML
- <script language="javascript" type="text/javascript">
- jQuery(document).ready(function($) {
- $("#TB_overlay").click(validateAltText);
- $("#TB_closeAjaxWindow").click(validateAltText);
- function validateAltText() {
- var value = $(".image_alt input").val();
- if (value)
- return true;
- alert('Please fill the Alt text');
- return false;
- }
- });
- </script>
- HTML;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement