Skip to content

Instantly share code, notes, and snippets.

@JamesHusband
Created February 7, 2017 12:06
Show Gist options
  • Save JamesHusband/f34512568d82f6c0de9892e1ff9c73cb to your computer and use it in GitHub Desktop.
Save JamesHusband/f34512568d82f6c0de9892e1ff9c73cb to your computer and use it in GitHub Desktop.
breaks on live works on staging
function lsmwp_post_limter($ids, $in, $count) {
$i = rand(1,$count);
if ($i <= $in) {
return($ids);
}
else
return false;
}
function lsmWpfilter($posts){
$result = [];
foreach($posts as $post){
$res = lsmwp_post_limter($post['postId'], $post['in'], $post['count']);
if ($res){
$result[] = $res;
}
}
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment