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 | |
function wpf_dont_sync_free_orders( $order_args ) { | |
if ( empty( $order_args['total'] ) ) { | |
return false; | |
} | |
return $order_args; | |
} |
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 | |
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 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 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 | |
// Deletes WordPress user when the "role" field is loaded from the CRM with a value of "deleted" | |
// Works when a webhook is received or a batch Pull User Meta operation is run. | |
function my_wpf_delete_user_by_field( $user_id, $user_meta ) { | |
if ( isset( $user_meta['role'] ) && $user_meta['role'] == 'deleted' && ! user_can( $user_id, 'manage_options' ) ) { | |
require_once( ABSPATH . 'wp-admin/includes/user.php' ); |
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 | |
// Disbale "Allow URL Login" in WP Fusion's settings for this to work properly. | |
/** | |
* True auto login. Format your URLs like: https://mysite.com/?cid=%CONTACTID%&email=%EMAILADDRESS%&key=%ACCESSKEY% | |
* | |
* Where %CONTACTID% is the ID of the contact | |
* %EMAIL% is the email address of the contact | |
* and %ACCESSKEY% is your access key from the bottom of the WP Fusion General settings tab |
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 | |
/** | |
* 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 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 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 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'] ) ) { |