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_dont_sync_free_orders( $order_args ) { | |
| if ( empty( $order_args['total'] ) ) { | |
| return false; | |
| } | |
| return $order_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 | |
| function add_field_keys_to_names( $fields ) { | |
| foreach ( $fields as $i => $category ) { | |
| foreach ( $category as $key => $label ) { | |
| $fields[ $i ][ $key ] = $label .= ' (' . $key . ')'; | |
| } | |
| } |
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 | |
| /** | |
| * Inherits access rules and redirects from ActiveMember360 for posts and pages. | |
| * | |
| * @param array $settings The WP Fusion settings on the post. | |
| * @param WP_Post|int $post_id The post or post ID. | |
| * @return array The settings. | |
| */ | |
| function inherit_am360_access_rules( $settings, $post_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
| import openai | |
| import requests | |
| import re | |
| import json | |
| openai.api_key = "X" | |
| # Define WooCommerce credentials. | |
| site_url = "https://yoursite.com/" |
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 | |
| /** | |
| * Allow active licenses to get updates if they're not at the limit, no matter what. | |
| * | |
| * @param bool $is_active Whether the site is active or not. | |
| * @param int $license_id The license ID. | |
| * @param string $passed_site_url The site URL. | |
| * | |
| * @return bool Whether the site is active or not. | |
| */ |
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 | |
| // Define a class for our plugin | |
| class MyPlugin { | |
| // Define a static property to hold the single instance of the class | |
| private static $instance; | |
| // Define a private constructor to prevent the class from being instantiated directly | |
| private function __construct() { | |
| // Add the admin settings page to the WordPress admin menu |
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 | |
| /** | |
| * Sets a transient to lock a user from receiving webhooks from the CRM for one minute | |
| * after tags have been applied by WP Fusion. | |
| * | |
| * @param int $user_id The user ID. | |
| */ | |
| function wpf_lock_user( $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 | |
| function inherit_memberium_access_rules( $settings, $post_id ) { | |
| if ( is_object( $post_id ) ) { | |
| $post_id = $post_id->ID; // wpf_settings_for_meta_box passes a WP_Post. | |
| } | |
| if ( empty( $settings['allow_tags'] ) ) { |
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 | |
| /** | |
| * Modify the EDD cancel URL to point custom cancellation page. | |
| * | |
| * @param string $url The cancel URL. | |
| * @param EDD_Subscription $subscription The subscription. | |
| */ | |
| function wpf_edd_subscription_cancel_url( $url, $subscription ) { |