unction remove_field_for_non_videos( $response, $attachment ) { if ( ! $this->is_video( $attachment ) ) { unset( $response->data[ $this->field_name ] ); } return $response; } } if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { wpcom_rest_api_v2_load_plugin( 'Automattic\Jetpack\VideoPress\WPCOM_REST_API_V2_Attachment_VideoPress_Field' ); }