Skip to content

Instantly share code, notes, and snippets.

View jonathanlaf's full-sized avatar

Jonathan Lafleur jonathanlaf

View GitHub Profile
@jonathanlaf
jonathanlaf / getClosestLowerValue.php
Last active August 14, 2018 12:54
[Closest value operator] Get closest value (of an array) before a given one #php #operand
<?php
function valueExpected ($analyse, $expect, $strict = false)
{
if ($strict)
{
if ($analyse === $expect)
{
return '<span style="background-color:darkolivegreen; color:darkgrey;">Received : ' .
$analyse .
', Expected : ' .
@jonathanlaf
jonathanlaf / wpex_pagination.php
Last active April 2, 2022 06:27
[wpexplorer's WordPress pagination script enhanced.] #wordpress
/*
* Numbered Pagination
* http://www.wpexplorer.com/pagination-wordpress-theme/
*/
if ( !function_exists( 'wpex_pagination' ) ) {
function wpex_pagination($wpex_query) {
$prev_arrow = is_rtl() ? '&rarr;' : '&larr;';
$next_arrow = is_rtl() ? '&larr;' : '&rarr;';
/*