Created
February 7, 2017 12:06
-
-
Save JamesHusband/f34512568d82f6c0de9892e1ff9c73cb to your computer and use it in GitHub Desktop.
breaks on live works on staging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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