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 | |
| // | |
| // Denies access to any content that was published before the user's registration date | |
| // | |
| function disallow_before_date_published( $can_access, $user_id, $post_id ) { | |
| $published = get_the_date( 'U', $post_id ); | |
| $userdata = get_userdata( $user_id ); |
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 | |
| // This runs every day and imports any new users from the connected CRM who have the specified tag ID ("123" in this example) | |
| // If contacts with that tag already have user accounts on the site they will be skipped and no data will be loaded | |
| // i.e. this just imports *new* users | |
| if ( ! wp_next_scheduled( 'wpf_daily_import' ) ) { | |
| wp_schedule_event( time(), 'daily', 'wpf_daily_import' ); | |
| } |
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 | |
| function wpf_bookable_products_meta_fields( $fields ) { | |
| $args = array( | |
| 'post_type' => 'product', | |
| 'nopaging' => true, | |
| 'meta_key' => 'WooCommerceEventsType', | |
| 'meta_value' => 'bookings', | |
| ); |
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 | |
| // 3 is the upgrade ID of a 1 site lifetime license | |
| // 4 is the upgrade ID of a 3 sites lifetime license | |
| // 1 to 4 are the price IDs of annual licenses | |
| // 5 is the price ID of a 1 site lifetime license | |
| // 6 is the price ID of a 3 site lifetime license | |
| function wpf_edd_sl_upgrade_cost( $cost, $license_id, $upgrade_id ) { |
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 | |
| // | |
| // Makes WP Fusion send Enhanced Ecommerce data when a WooCommerce order is created in Pending status, instead of waiting for Processing | |
| // | |
| function wpf_woocommerce_run_on_pending( $order_id ) { | |
| if ( ! function_exists( 'wp_fusion' ) ) { | |
| return; |
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 | |
| function wpf_extend_timeout( $args, $url ) { | |
| $args['timeout'] = 60; | |
| return $args; | |
| } |
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 | |
| /*********************************************************************** | |
| * Salesforce Create Inquiry | |
| ***********************************************************************/ | |
| function red_new_business_inquiry_submission( $entry, $form ) { | |
| // Switch Salesforce integration to the Inquiry_Form__c object type |
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 | |
| // Widget form | |
| function cust_widget_form( $widget, $return, $instance ) { | |
| if( ! isset( $instance['logged_out_only'] ) ) { | |
| $instance['logged_out_only'] = 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
| <?php | |
| function skip_contact_creation( $user_meta, $user_id ) { | |
| if ( isset( $user_meta['receive_press_releases'] ) && true != $user_meta['receive_press_releases'] ) { | |
| $user_meta = null; | |
| } | |
| return $user_meta; |