Advertisement
phpface

VideoTube

Aug 3rd, 2023
1,096
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. add_filter( 'do_ajax_submit_video_errors', function( $errors, $data ){
  2.  
  3.     $data = wp_parse_args( $data, array(
  4.         '_thumbnail_id' =>  0
  5.     ) );
  6.  
  7.     if( ! $data['_thumbnail_id'] ){
  8.         $errors->add(
  9.             'no_thumbnail',
  10.             esc_html__( 'Thumbnail image is required', 'videotube' )
  11.         );
  12.     }
  13.  
  14.     return $errors;
  15.  
  16. }, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement