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( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); | |
function woo_remove_product_tabs( $tabs ) { | |
unset( $tabs['description'] ); // Remove the description tab | |
unset( $tabs['reviews'] ); // Remove the reviews tab | |
unset( $tabs['additional_information'] ); // Remove the additional information tab | |
return $tabs; | |
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( 'woocommerce_get_price_html', 'my_price_html', 100, 2 ); | |
function my_price_html( $price, $product ){ | |
return 'Was:' . str_replace( '<ins>', ' Now:<ins>', $price ); | |
} |
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
remove_action('init', 'woocommerce_update_cart_action'); //Remove cart update action so that billing address will be updated | |
add_action('init','woocommerce_update_billing'); //Hook own function to update billing address on cart update | |
function woocommerce_update_billing(){ | |
global $woocommerce; | |
if(! empty( $_POST['update_cart'] ) && $woocommerce->verify_nonce('cart')) { | |
$customer_id = get_current_user_id(); | |
$billing_data['billing_first_name' ] = $_POST['billing_first_name' ]; | |
$billing_data['billing_last_name' ] = $_POST['billing_last_name' ]; | |
$billing_data['billing_phone' ] = $_POST['billing_phone' ]; | |
$billing_data['billing_email' ] = $_POST['billing_email' ]; |
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
/********************************** example **************************************/ | |
var base_url = 'http://people.cs.uct.ac.za/~swatermeyer/VulaMobi/'; | |
function example() | |
{ | |
var response = ""; | |
var form_data = { | |
username: username, | |
password: password |
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
window.location.hash = '#edit'; |
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('wp_insert_post_data', 'ccl', 99); | |
function ccl($data) { | |
if ($data['post_type'] !== 'revision' && $data['post_status'] == 'publish') { | |
$data['post_status'] = 'draft'; | |
add_filter('redirect_post_location', 'my_redirect_post_location_filter', 99); | |
} | |
return $data; | |
} | |
Then add a message variable in the redirect filter function. |
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
private function _createSlug($text) | |
{ | |
$text = preg_replace('~[^\\pL\d]+~u', '-', $text); | |
$text = trim($text, '-'); | |
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); | |
$text = strtolower($text); | |
$text = preg_replace('~[^-\w]+~', '', $text); | |
if (empty($text)) | |
{ | |
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
<?php | |
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; | |
define('WP_DEBUG', false); | |
define('WP_HOME', $protocol . $_SERVER['HTTP_HOST']); | |
define('WP_SITEURL', $protocol . $_SERVER['HTTP_HOST']); | |
define('WP_CONTENT_URL', '/wp-content'); | |
define('DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST']); | |
?> |
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 | |
if (!function_exists('get_post_id_by_meta_key')) { | |
/** | |
* Get post id from meta key and value | |
* @param string $key | |
* @return int|bool | |
* @author Sajid Zaman <sajidzaman@live.com> | |
*/ | |
function get_post_id_by_meta_key($key) { | |
global $wpdb; |
OlderNewer