$args = array(
'numberposts' => 1000,
'category' => $categoryId,
'orderby' => 'meta_value_num',
'order' => 'ASC',
'include' => array(),
'exclude' => array(),
'meta_key' => 'ORDER',
'meta_value' => '',
'post_type' => 'post',
'suppress_filters' => true,
'meta_query' => array(
array(
'key' => 'PRIVATE ',
'value' => '1',
'compare' => 'NOT IN',
),
),
);
$posts = get_posts($args);
$content = preg_replace('/<a href=(\S*)>(.*?)<\/a>/', '<a href=$1 target="_blank">$2</a>', $content);
$pattern = "~(http|https|ftp|ftps)://(.*?)(\s|\n|[,.?!](\s|\n)|$)~";
$content = preg_replace($pattern, 'http://docs.google.com/viewer?url=$1://$2', $content);