Skip to content

Instantly share code, notes, and snippets.

View klihelp's full-sized avatar
🎯
Focusing on life and money farm

klihelp

🎯
Focusing on life and money farm
View GitHub Profile
@klihelp
klihelp / kli-js-elapsed-time.js
Last active September 18, 2015 07:00
Get elapsed time, time ago, supports timezone
/**
* Get elapsed time, time ago, supports timezone
* @param integer time --- string | unix timestamp
* @param strings --- string | array
* @return string elapsed time
*/
function(datetime, strings, elative_to) {
if (arguments.length) {
var datetime = typeof datetime !== 'string' ? datetime : new Date(datetime)
@klihelp
klihelp / kli-wp-api-modify-post-response-fields.php
Created February 1, 2015 19:44
WP-API modify post response fields
<?php
/**
* WP-API modify post response fields
*
*/
/**
* Posts per page
*/
function kli_wp_api_query_post_per_page( $query ){
@klihelp
klihelp / kli - webapp - html css js - custom cursor.html
Last active August 29, 2015 14:13
Kli-WebApp - Custom Cursor with HTML/JS/CSS
<!--
// From Klihelp:
// https://gist.github.com/klihelp/67798dfc1266c3684326
//
// The idea is that
// - we hide the real cursor
// - and #custom_cursor div will follow the cursor, inside this div can have any text or image
-->
@klihelp
klihelp / kli-wp-api-remove-featured-image-field.php
Last active February 18, 2016 04:18
WP-API remove featured_image field
<?php /*
Plugin Name: Dynamic Image Resizer
Plugin URI: http://ottopress.com
Author: Otto42 / Modified by JochenT
Author URI: http://ottodestruct.com
Version: 1.0.0.1.jt-3 (11.10.2013)
Description: Change the WordPress image uploader system to do image resizing on the fly.
*/
/*
@klihelp
klihelp / kli-wp-prefix-posts-slugs.php
Last active August 29, 2015 13:57
WordPress - Prefix Custom Post Type posts slugs
<?php
/**
* Prefix Posts Slugs
* This hooks into wp_unique_post_slug and adds prefix to post slug. Eg: have post Hello title and slug will be my-prefix-hello.
* @author Klipolis
* @since 0.1.0
* @version 0.1.0
* @access public
* @main WordPress
*/
@klihelp
klihelp / kli-plugin-isolation.php
Created March 12, 2014 12:48
WordPress Plugin Isolation helper
<?php
/**
* WordPress Plugin Isolation helper
* This helps your plugin/theme to have isolated webpages, keeping only your organized prefixed hooks.
* @package Hashtagg
* @subpackage Base
* @author Klipolis
* @copyright 2014 Klipolis
* @since 0.1.0
* @version 0.1.0
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: http://www.rarst.net/
License: MIT
*/
/**
@klihelp
klihelp / wc-pagination-functions.php
Last active June 6, 2022 03:37
WooCommerce shortcode pagination on pages
<?php
/**
* Thanks for James Kemp / Iconic turning the idea into a plugin
* https://wordpress.org/plugins/shortcode-pagination-for-woocommerce
*
* This code shows pagination for WooCommerce shortcodes when it's embeded on single pages.
* Include into functions.php.
*/
if ( ! is_admin() ) {