Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if( ! function_exists( 'videotube_child_do_restrict_featured_tag' ) ){
- /**
- * Filter the WP_error
- * @param $errors
- * @param $submit_data
- */
- function videotube_child_do_restrict_featured_tag( $errors, $submit_data ) {
- // Change your featured tag name here.
- $my_featured_tag_name = 'featured';
- if( isset( $submit_data['video_tag'] ) ){
- $video_tags = explode(",", $submit_data['video_tag'] );
- // Check if submitted data contains the featured tag.
- if( array_search( $my_featured_tag_name, $video_tags ) !== false ){
- // add an error if tag found.
- $errors->add( "video-tag", esc_html__( 'Sorry, you cannot enter the featured tag.' ));
- }
- }
- return $errors;
- }
- add_filter( 'do_ajax_submit_video_errors' , 'videotube_child_do_restrict_featured_tag', 10, 2 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement