Skip to content

Instantly share code, notes, and snippets.

View pkarjala's full-sized avatar

Patrick A. Karjala pkarjala

View GitHub Profile
@paragonie-scott
paragonie-scott / crypto-wrong-answers.md
Last active August 17, 2024 06:33
An Open Letter to Developers Everywhere (About Cryptography)
@siteoptimo
siteoptimo / WP_User_Query Order by RAND
Last active November 8, 2022 19:34
This will allow to order a wordpress user query by random.
<?php
// put this in your functions.php
add_filter('pre_user_query', function(&$query) {
if($query->query_vars["orderby"] == 'rand') {
$query->query_orderby = 'ORDER by RAND()';
}
});
// Query will look like this:
$args = array('orderby' => 'rand', 'number' => 5);