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 |
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
/* | |
$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 | |
// 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
/************************* | |
* 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
1. load media in controller / function.php / plugins | |
``` | |
function enqueue_media_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 | |
add_filter( 'woocommerce_product_data_tabs', 'add_my_custom_product_data_tab' , 99 , 1 ); | |
function add_my_custom_product_data_tab( $product_data_tabs ) { | |
/* | |
to remove this product type unset all product type | |
unset($product_data_tabs['general']); | |
unset($product_data_tabs['inventory']); | |
unset($product_data_tabs['shipping']); | |
unset($product_data_tabs['linked_product']); |
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
add_filter( 'post_updated_messages', 'update_new_messages' ,100); | |
function update_new_messages( $messages ) { | |
$post = get_post(); | |
$post_type = get_post_type( $post ); | |
$post_type_object = get_post_type_object( $post_type ); | |
if($post_type != 'product') | |
return; |
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
add_filter('manage_inquiry_posts_columns', 'custom_table_head'); | |
function custom_table_head( $defaults ) { | |
$defaults['author'] = 'Inquiry By'; | |
$defaults['date'] = 'Created Date'; | |
return $defaults; | |
} |
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
function my_custom_text_strings( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Show all product types' : | |
$translated_text = __( 'Show all solutions types', 'woocommerce' ); | |
break; | |
case 'Sort Products' : | |
$translated_text = __( 'Show Solutions', 'woocommerce' ); | |
break; | |
case 'Product Data' : | |
$translated_text = __( 'Solutions Data', 'woocommerce' ); |
OlderNewer