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
if( is_cart() && WC()->cart->cart_contents_count == 0){ | |
wp_safe_redirect( get_permalink( woocommerce_get_page_id( 'shop' ) ) ); | |
} |
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
$woocommerce->cart->empty_cart(); |
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
// Get an instance of the WC_Order object | |
$order = wc_get_order( $order_id ); | |
$order_data = $order->get_data(); // The Order data | |
$order_id = $order_data['id']; | |
$order_parent_id = $order_data['parent_id']; | |
$order_status = $order_data['status']; | |
$order_currency = $order_data['currency']; | |
$order_version = $order_data['version']; |
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
print("<pre>".print_r($customer_orders,true)."</pre>"); |
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
header('Location: '.$newURL); | |
die(); |
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
//randomnizer with seed | |
function fyshuffle(&$items,$seedstring) { | |
if (!$seedstring) { | |
$seedval = time(); | |
} else { | |
if (is_numeric($seedstring)) { | |
$seedval = $seedstring; | |
} else { | |
$seedval = crc32($seedstring); | |
} |
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 | |
include '../../../../wp-load.php'; | |
global $wpdb; | |
$table_name = "wp_posts"; | |
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name) { | |
//Your code here | |
} | |
?> |
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
// Get parameters out of the url | |
function getQueryVariable(variable){ | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); | |
for (var i=0;i<vars.length;i++) { | |
var pair = vars[i].split("="); | |
if(pair[0] == variable){return pair[1];} | |
} | |
return(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
the_post_thumbnail_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
add_action('get_header', 'remove_admin_login_header'); | |
function remove_admin_login_header() { | |
remove_action('wp_head', '_admin_bar_bump_cb'); | |
} |