Skip to content

Instantly share code, notes, and snippets.

View gizalink's full-sized avatar

Nguyễn Phúc Gia Linh gizalink

View GitHub Profile
@gizalink
gizalink / gist:f14c0b02cd307eec4ef5
Last active October 13, 2015 09:22 — forked from thachpham92/gist:d57b18cf02e3550acdb5
Tất cả các tham số trong WP_Query
// Source: https://gist.github.com/luetkemj/2023628
<?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ả
'author__not_in' => array( 2, 6 ), //(array)' - Các ID của tác giả không muốn lấy bài
@gizalink
gizalink / delete-targz.php
Created October 25, 2015 06:47 — forked from Xeroday/delete-targz.php
Deletes .tar.gz files older than 7 days.
<?php
$files = glob("*.tar.gz");
foreach($files as $file) {
if(is_file($file)
&& time() - filemtime($file) >= 7*24*60*60) { // 7 days
unlink($file);
}
}
?>
@gizalink
gizalink / 0_reuse_code.js
Created September 3, 2017 15:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gizalink
gizalink / woo_rename_checkout.php
Created July 16, 2019 15:48 — forked from cryptexvinci/woo_rename_checkout.php
Rename WooCommerce checkout field label & placeholder
// WooCommerce Rename Checkout Fields
add_filter( 'woocommerce_checkout_fields' , 'custom_rename_wc_checkout_fields' );
// Change placeholder and label text
function custom_rename_wc_checkout_fields( $fields ) {
$fields['billing']['billing_first_name']['placeholder'] = 'Wonka';
$fields['billing']['billing_first_name']['label'] = 'Your Awesome First Name';
return $fields;
}