Tagged: ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1341226

    Hi guys! Thank you for your attantion!
    How I can make this fields *required?
    https://disk.yandex.ru/i/x2PAscwBLVFNfg

    #1341409

    Hey mischael1,
    These fields are part of the WordPress core nad there are no settings to achieve this, I did find this solution on stackexchange but it is 4 years old and doesn’t seem well-reviewed, I would recommend looking for a plugin.
    I assume that you want this so your clients will use these fields, but your best option would be to explain this to them.

    Best regards,
    Mike

    #1341822

    This is not good solution, but it works. Possible it will be usefull for somebody.
    In this code script every second checking fields alt and copyright and if one of them empty it disabling Insert button.
    Put it into \wp-admin\admin-footer.php

    <script>
    $(function(){
    
    setInterval(function(){
    		
    		var a = $('.compat-field-av_copyright_field input')
    		var b = $('#attachment-details-alt-text')
    		if(a[0].value === '' || b[0].value === '')
    			
    		     $('.media-toolbar-primary button').attr("disabled",true);
    		else if(a[0].value !== '' && b[0].value !== '')
    		     $('.media-toolbar-primary button').attr("disabled",false);
    
    }, 1000
    
    )
    }
    )
    </script>
    #1341836

    Hi,

    Thanks for sharing your solution!

    Best regards,
    Yigit

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.