Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mandatory_product_fields(){
- echo "<script>
- document.addEventListener('DOMContentLoaded', function(event) {
- if(window.location.href.includes('post-new.php?post_type=product')){
- document.getElementById('post').onsubmit = function(){
- var currentThumbnailId = document.getElementById('_thumbnail_id').value;
- if(currentThumbnailId == -1){
- alert('Please set product image.');
- return false;
- }
- }
- }
- });
- </script>";
- }
- mandatory_product_fields();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement