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
['change', 'keyup', 'paste', 'input', 'propertychange', 'every_other_event_you_want'].forEach(eventType => { | |
[...document.querySelectorAll('SELECTOR')].forEach(element => { | |
element.addEventListener(eventType, (event) => { | |
console.log(event); | |
// Your callback here | |
}, false); | |
}); | |
}); |
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
// Source: https://gist.github.com/luetkemj/2023628 | |
// Xem hướng dẫn WP_Query toàn tập: http://goo.gl/kRpzTz | |
<?php | |
$args = array( | |
//////Author Parameters - Tham số lấy bài viết theo tác giả | |
//http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters | |
'author' => '1,2,3,', //(int) - Các ID tác giả cần lấy bài viết (thêm dấu - vào để loại trừ tác giả, ví dụ: -14, -20) | |
'author_name' => 'luetkemj', //(string) - Lấy bài viết dựa theo tên nick name của tác giả | |
'author__in' => array( 2, 6 ), //(array) - Lấy bài dựa theo ID của tác giả |
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
url_sq : s small square 75x75 | |
url_q : q large square 150x150 | |
url_t : t thumbnail, 100 on longest side | |
url_s : m small, 240 on longest side | |
url_n : n small, 320 on longest side | |
url_m : - medium, 500 on longest side | |
url_z : z medium 640, 640 on longest side | |
url_c : c medium 800, 800 on longest side† | |
url_l : b large, 1024 on longest side* | |
url_o : o original image, either a jpg, gif or png, depending on source format |
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
// ==UserScript== | |
// @name Google Translate Tooltip | |
// @namespace steely.wing | |
// @version 1.10 | |
// @description Translates selected text into a tooltip. | |
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html | |
// @copyright 2014, Wing Leong (http://steelywing.iblogger.org/) | |
// @include * | |
// @require http://code.jquery.com/jquery-2.1.0.min.js | |
// @grant GM_getValue |
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
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
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
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |
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
<?php | |
/** | |
* Detect if the browser is Internet Explorer or not | |
* @package WordPress | |
* @param int $version optional | |
* @return Boolean | |
*/ | |
function is_IE($version = 0) | |
{ | |
$flg = false; |