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 | |
// Disable Ready Only for Administrators | |
// add_filter( 'acf/load_field', 'yanco_acf_disable_read_only', 10000 ); | |
function yanco_acf_disable_read_only( $field ) { | |
// Applies to administrators | |
if( is_admin() && get_post_type() == 'afrapportering' ) { | |
global $pagenow; | |
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 | |
/* | |
* Adjust the interval that the feed file is generated. | |
*/ | |
add_filter( 'wc_facebook_feed_generation_interval', 'yanco_wc_facebook_feed_generation_interval', 10, 1 ); | |
function yanco_wc_facebook_feed_generation_interval( $interval ) { | |
return 60 * 30; | |
} |
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 | |
add_action('woocommerce_subscription_status_pending-cancel', 'yanco_woocommerce_subscription_status_pending_cancel', 10, 3 ); | |
function yanco_woocommerce_subscription_status_pending_cancel( $subscription ) { | |
$customer_email = $subscription->get_billing_email(); | |
$wc_emails = WC()->mailer()->get_emails(); | |
$admin_email = $wc_emails['WCS_Email_Cancelled_Subscription']->recipient; | |
$wc_emails['WCS_Email_Cancelled_Subscription']->trigger( $subscription ); |
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 | |
/** | |
* Add privacy policy tick box at checkout | |
*/ | |
add_action( 'woocommerce_review_order_before_submit', 'yanco_add_checkout_privacy_policy', 9 ); | |
function yanco_add_checkout_privacy_policy() { | |
woocommerce_form_field( 'privacy_policy', array( | |
'type' => 'checkbox', | |
'class' => array('form-row privacy'), |
OlderNewer