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
document.addEventListener( 'wpcf7mailsent', function( event ) { | |
var name = jQuery("input[name=your-name]").val(); | |
var email = jQuery("input[name=your-email]").val(); | |
var phone = jQuery("input[name=tel-151]").val(); | |
var date = jQuery("input[name=date-146]").val(); | |
var msg = jQuery("textarea[name=your-message]").val(); | |
jQuery.post ('http:/url.tld?' + 'username=static_value' + '&password=static_value' + '&source=static_value' + '&clientName=' + name + '&clientEmail=' + email + '&clientPhone=' + phone + '&programmingDate=' + date + '&message=' + msg );}, false ); |
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
add_action( 'woocommerce_single_product_summary', 'add_after_description_rwk', 25 ); | |
function add_after_description_rwk() { | |
?> | |
<div class="button">HIT ME</div> | |
<?php } |
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
function WC() { | |
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart'); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart'); | |
return WooCommerce::instance(); | |
} |
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
function hide_update_notice_to_all_users() { | |
remove_action( 'admin_notices', 'update_nag', 3 ); | |
add_action('init', create_function('$a',"remove_action( 'init', 'wp_version_check' );"),2); | |
add_filter('pre_option_update_core','__return_null'); | |
add_filter('pre_site_transient_update_core','__return_null'); | |
} | |
add_action( 'admin_head', 'hide_update_notice_to_all_users', 1 ); |
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
function rwk_change_query( $comments ) { | |
$comments->query_vars['order'] = 'DESC'; | |
$comments->meta_query->parse_query_vars( $comments->query_vars ); | |
} | |
add_action( 'pre_get_comments', 'rwk_change_query' ); |
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
//Display the rating on a submitted comment. | |
add_filter( 'comment_text', 'ci_comment_rating_display_rating' ); | |
function ci_comment_rating_display_rating( $comment_text ) { | |
if ( $rating = get_comment_meta( get_comment_ID(), 'rating', true ) ) { | |
$stars = '<p class="stars">'; | |
for ( $i = 1; $i <= 5 ; $i ++ ) { | |
if ( $i <= $rating ) { | |
$stars .= '<span class="dashicons dashicons-star-filled"></span>'; | |
} else { |
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
SELECT meta_value | |
FROM wprh_postmeta | |
WHERE meta_key = '_sku' | |
AND meta_value != '' | |
GROUP BY meta_value HAVING COUNT(meta_value) > 1 |
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
add_action('admin_head', 'rwk_refund_field', 999); | |
function rwk_refund_field() { | |
$currentPostType = get_post_type(); | |
// filter for shop only | |
if( $currentPostType != 'shop_order' ) { | |
return; | |
} | |
// remove the blocker |
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
// tweak for city shipping options | |
add_filter('woocommerce_package_rates', 'restrict_shipping_options_based_on_city', 10, 2); | |
function restrict_shipping_options_based_on_city($available_shipping_methods, $package){ | |
global $woocommerce; | |
// Config this array with city names and corresponding shipping methods to hide. | |
$country_list = array( | |
'Cefa' => array('flat_rate','free_shipping'), | |
); | |
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
//for js | |
$(document).bind("contextmenu", function (e) { | |
return false; | |
}); | |
//for wp | |
jQuery(document).bind("contextmenu", function (e) { | |
return false; | |
}); |