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
public function get_subscription_plan_id( $feed, $payment_amount, $trial_period_days, $currency = '' ) { | |
$safe_feed_name = preg_replace( '/[^a-z0-9_\-]/', '', strtolower( $feed['meta']['feedName'] ) ); | |
$safe_billing_cycle = $feed['meta']['billingCycle_length'] . $feed['meta']['billingCycle_unit']; | |
$safe_trial_period = $trial_period_days ? 'trial' . $trial_period_days . 'days' : ''; | |
$safe_payment_amount = $this->get_amount_export( $payment_amount, $currency ); | |
/* | |
* Only include the currency code in the plan id when the entry currency does not match the plugin currency. | |
* Ensures the majority of plans created before this change will continue to be used. |
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( 'transition_post_status', 'update_expired_post_meta', 10, 3 ); | |
function update_expired_post_meta( $new_publish_status, $old_publish_status, $post ){ | |
if( 'expired' == $new_publish_status ){ | |
// Change the ACF field value to false | |
update_field( 'field_name', false, $post->ID ); | |
} |
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('acf/load_field/name=field_name', 'acf_readonly' ); | |
function acf_readonly( $field ) { | |
$field['readonly'] = 1; | |
return $field; | |
} |
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 | |
/** | |
* MOD: Better Limit Submissions Per Time Period by User or IP (without hiding form & spanning limit across a group of forms) | |
* | |
* Based On: http://gravitywiz.com/2012/05/12/limit-ip-to-one-submission-per-time-period | |
* Video: http://screencast.com/t/I11vWq02Qswn | |
* | |
* Note: This mod does not require the original snippet. Most of the parameters still function the same as the snippet it | |
* is based on. The only exception is the 'form_id' parameter which now accepts an array of form IDs rather than a single | |
* form ID. |