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
<?php | |
// Do NOT include the opening php tag | |
add_filter( 'automatewoo/rules/includes', 'wpdesk_automatewoo_rules' ); | |
/** | |
* Custom Rules | |
* | |
*/ | |
function wpdesk_automatewoo_rules( $rules ) { |
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
<?php | |
// Do NOT include the opening php tag | |
/** | |
* Function to validate the length | |
* | |
*/ | |
function wpdesk_fcf_validate_length( $field_label, $value ) { | |
$min_length = 3; | |
$max_length = 20; |
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
<?php | |
// Do NOT include the opening php tag | |
/** | |
* Function to validate the URL | |
* | |
*/ | |
function wpdesk_fcf_validate_url( $field_label, $value ) { | |
if ( filter_var( $value, FILTER_VALIDATE_URL ) == false ) { | |
wc_add_notice( sprintf( '%s is not a valid URL.', '<strong>' . $field_label . '</strong>' ), 'error' ); |
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
<?php | |
// Do NOT include the opening php tag | |
/** | |
* Function to validate the number | |
* | |
*/ | |
function wpdesk_fcf_validate_number( $field_label, $value ) { | |
if ( ! ( ( is_numeric( $value ) ? intval( $value ) == $value : false ) ) ) { | |
wc_add_notice( sprintf( '%s is not a valid number.', '<strong>' . $field_label . '</strong>' ), 'error' ); |
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
<?php | |
// Do NOT include the opening php tag | |
add_filter( 'woocommerce_payment_status_note', 'wpdesk_payment_status_note' ); | |
/** | |
* Change order note for WooCommerce Automatic Payment Status | |
* | |
*/ | |
function wpdesk_payment_status_note() { | |
return 'Order completed. Yeah!'; |
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
<!– Offer Conversion: cps test 5 –> | |
<img src="xyz.go2cloud.org/aff_l?offer_id=2141&amount=<?php echo $order->get_total(); ?>" width="1" height="1" /> | |
<!– // End Offer Conversion –> |
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
<?php | |
// Do NOT include the opening php tag | |
add_action( 'wp_head', 'wpdesk_custom_js' ); | |
// Add inline JS | |
function wpdesk_custom_js() { | |
echo <<<JS | |
<script type="text/javascript"> | |
// Add your JS here | |
</script> |
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
<?php | |
/* | |
Plugin Name: Disable Translation Updates | |
Description: Disables automatic plugins translations by WordPress.org. | |
Author: wpdesk | |
License: GPLv2 or later | |
*/ | |
add_filter( 'auto_update_translation', 'wpdesk_disable_translation_updates', 10, 2 ); | |
/** |
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
<?php | |
// Do NOT include the opening php tag | |
add_action( 'woocommerce_before_cart_table', 'wpdesk_cart_free_shipping_text' ); | |
/** | |
* Add "free shipping" text to WooCommerce cart page | |
* | |
*/ | |
function wpdesk_cart_free_shipping_text() { | |
echo '<div class="woocommerce-info">Free Shipping available from $299!</div>'; |