This file contains hidden or 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
<p><strong>Headings</strong></p> | |
<h1>Header one</h1> | |
<h2>Header two</h2> | |
<h3>Header three</h3> | |
<h4>Header four</h4> | |
<h5>Header five</h5> | |
<h6>Header six</h6> | |
<h2>Blockquotes</h2> | |
<p>Single line blockquote:</p> | |
<blockquote><p>Stay hungry. Stay foolish.</p></blockquote> |
This file contains hidden or 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 | |
function wp_dereg_script_comment_reply(){ | |
wp_deregister_script( 'comment-reply' ); | |
} | |
add_action('init','wp_dereg_script_comment_reply'); | |
add_action('wp_head', 'wp_reload_script_comment_reply'); | |
function wp_reload_script_comment_reply() { | |
?> |
This file contains hidden or 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 | |
$variable = "Some value"; // bisa array juga. | |
add_action( 'hook_name, function() use ($variable) { | |
// callback. | |
}); |
This file contains hidden or 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 | |
// Pastikan plugin berikut telah terinstall & aktif | |
// Action Scheduler : https://wordpress.org/plugins/action-scheduler/ | |
// WP Monolog : https://git.tonjoo.com/tonjoo/wp-monolog | |
/** | |
* Create job queue | |
* | |
* Param 1: Timestamp kapan job akan dirun. Isi pakai time() kalau job ingin dirun sekarang juga. |
This file contains hidden or 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 | |
// method 1. | |
add_filter( 'woocommerce_checkout_fields', function( $fields ) { | |
$fields['billing']['billing_state']['label'] = 'Provinsi'; | |
$fields['billing']['billing_city']['label'] = 'Kabupaten'; | |
$fields['billing']['billing_district']['label'] = 'Kecamatan'; | |
$fields['shipping']['shipping_state']['label'] = 'Provinsi'; | |
$fields['shipping']['shipping_city']['label'] = 'Kabupaten'; | |
$fields['shipping']['shipping_district']['label'] = 'Kecamatan'; |
This file contains hidden or 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 | |
add_action( 'admin_menu', 'tair_admin_menu' ); | |
function tair_admin_menu() { | |
add_menu_page( 'Tes airtable', 'Tes airtable', 'manage_options', 'tair', 'tair_admin' ); | |
} | |
function tair_admin() { | |
global $wp_version; | |
$records = wp_remote_get( 'https://api.airtable.com/v0/appOc1ESRgBBFWbW9/Places?view=High%20priority', array( |
This file contains hidden or 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 | |
$rules = array( | |
"ruleset_f45Is7PCFWd4mjU" => array( | |
"label" => "Ruleset Name", | |
"enabled" => true, | |
"rules" => array( | |
"rule_mVk9lHtMJLw38vD" => array( | |
"label" => "Rule Name", | |
"method" => "bulk", | |
"rewards" => array( |
This file contains hidden or 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
set @latitude = xxx; — center latitude | |
set @longitude = xxx; — center longitude | |
set @distance = xx; — search distance (miles) | |
select p.ID, p.post_name, ((ACOS(SIN(@latitude * PI() / 180) * SIN('latitude.meta_value' * PI() / 180) + COS(@latitude * PI() / 180) * COS('latitude.meta_value' * PI() / 180) * COS((@longitude – 'longitude.meta_value') * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS distance | |
from wp_posts p | |
left join wp_postmeta latitude on latitude.post_id = p.ID and latitude.meta_key = '_latitude' | |
left join wp_postmeta longitude on longitude.post_id = p.ID and longitude.meta_key = '_longitude' | |
having distance < @distance; |
This file contains hidden or 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
class Flash_Alert { | |
private $session; | |
function __construct() { | |
$this->session = new \Tiga\Session(); | |
} | |
public function error($message) { | |
$this->add('danger', $message); |
This file contains hidden or 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 | |
add_filter('pok_rates', 'filter_couriers', 10, 2); | |
function filter_couriers($rates, $package) { | |
$filtered_rates = array(); | |
$selected_courier = array( | |
'JNE - REG', | |
'JNE - OKE', | |
'JNE - YES' | |
); |
NewerOlder