Add Unique Classes to Next and Previous in WP_LINK_PAGES

First, I would add a string formatting placeholder to ‘link_before’, like so…

$args['link_before'] = '<span class="classlinks %s">';

Next, I would use sprintf() to insert an appropriate class for the appropriate link (let’s assume the classes will be ‘link-before’ and ‘link-after’, respectively). Like so…

if($page-1) // there is a previous page 
    $args['before'] .= ' '. _wp_link_page($page-1) . sprintf($args['link_before'],'link-before') . $args['previouspagelink'] . $args['link_after'] . '</a>' . ' ' ; 

if ($page<$numpages) // there is a next page 
    $args['after'] = ' '. _wp_link_page($page+1) . sprintf($args['link_before'],'link-after') . $args['nextpagelink'] . $args['link_after'] . '</a></div>' ;