Skip to content

Instantly share code, notes, and snippets.

@phuclh
Last active August 29, 2015 14:17
Show Gist options
  • Save phuclh/e25b271d3e53dbdf96a6 to your computer and use it in GitHub Desktop.
Save phuclh/e25b271d3e53dbdf96a6 to your computer and use it in GitHub Desktop.
<?php
$array = [];
$excludeItems = [];
if(isset($exclude) && !empty($exclude)) $excludeItems = array_map('trim', explode(',', $exclude));
if (count($excludeItems)) $array['post__not_in'] = $excludeItems;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment