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
/************************* | |
* Enqueue Media Uploader | |
*************************/ | |
function enqueue_admin_scripts() { | |
if(function_exists('wp_enqueue_media')) { | |
wp_enqueue_media(); | |
} | |
else { | |
wp_enqueue_script('media-upload'); | |
wp_enqueue_script('thickbox'); |
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 | |
// Skip the cart and redirect to check out url when clicking on Add to cart | |
add_filter ( 'add_to_cart_redirect', 'redirect_to_checkout' ); | |
function redirect_to_checkout() { | |
global $woocommerce; | |
// Remove the default `Added to cart` message | |
wc_clear_notices(); | |
return $woocommerce->cart->get_checkout_url(); | |
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
/* | |
$locations = array('longitude,latitude') | |
*/ | |
function getDistance($locations) | |
{ | |
$waypoints = $locations; | |
if(count($waypoints) > 2) | |
{ | |
unset($waypoints[0]); | |
unset($waypoints[count($locations) - 1]); |
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 | |
/** | |
* This is a very basic getting started example for setting up a basic project using PSR-4 and | |
* using composer's autoloader to run the tests. | |
* | |
*/ | |
// Create directory MyApp | |
// Inside MyApp/ create composer.json with the below contents |
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
<IfModule mod_ssl.c> | |
<VirtualHost _default_:443> | |
ServerAdmin [email protected] | |
ServerName tonjooblog.dev | |
ServerAlias www.tonjooblog.dev | |
DocumentRoot /var/www/tonjooblog | |
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn, | |
# error, crit, alert, emerg. | |
# It is also possible to configure the loglevel for particular |
NewerOlder