Here’s one way to achieve that is by constructing the <option>
tags with the wp_link_pages_link
filter:
add_filter( 'wp_link_pages_link', function( $link, $i )
{
return sprintf(
'<option value="%d" %s>%d</option>',
$i,
selected( $i, get_query_var( 'page', 1 ), 0 ),
$i
);
}, 10, 2 );
and then the <form>
and <select>
tags with the wp_link_pages
filter:
add_filter( 'wp_link_pages', function( $links )
{
if( empty( $links ) )
return $links;
return sprintf(
'<form method="GET" action="">
<select name="page">%s</select>
<input type="submit" value="%s"/>
</form>',
$links,
esc_html__( 'Go to page', 'mydomain' )
);
} );
Here’s how it looks like in the Twenty Sixteen theme:
Hope you can adjust it to your needs!