adding plugin code,
based on original display-posts pull request (https://github.com/billerickson/display-posts-shortcode/pull/48),
with suggested alternative approach by Bill Erickson (https://gist.github.com/billerickson/4efaf760b53a0eb63621).