/** * Add a commodity code to all line items sent to Stripe. * * @param string|null $code The commodity code. * @param int $download_id The download ID. * @param array $cart_item The cart item. * @return string|null The commodity…Continue reading
/** * Plugin Name: Pixelsz – Simplicate abonnementen (v2.0) * Description: Zoekt organisatie op basis van website (custom veld “Website”) en toont abonnementen (Hosting/Beheer/Onderhoud en SEO) op tabblad Simplicate. * Author: Pixelsz * Version: 2.0.0 */ if (!defined(‘ABSPATH’)) exit; /**…Continue reading
/** * 1) Register custom AutomateWoo product display template * 2) Sort items alphabetically when that template is used */ /* ——————————————— * 1) Register the new template for {{ order.items }} * ——————————————- */ add_filter( ‘automatewoo/variables/product_templates’, ‘rd_aw_register_product_templates’, 10 );…Continue reading
function rd_align_subscription_next_payment( $workflow ) { if ( ! class_exists( ‘WooCommerce’ ) || ! function_exists( ‘wcs_get_subscription’ ) ) { return; } $subscription = $workflow->data_layer()->get_subscription(); if ( ! $subscription || ! is_a( $subscription, ‘WC_Subscription’ ) ) { wc_get_logger()->error( ‘No valid subscription found…Continue reading
/** * WPCode Snippet: Auto-Create .htaccess in Uploads Folder for Force Download * Description: Creates/updates .htaccess in wp-content/uploads to force .txt file downloads * Location: Run Everywhere * Priority: 10 */ defined( ‘ABSPATH’ ) || exit; /** * Create or…Continue reading
add_action( ‘gform_user_updated’, ‘add_additional_roles’, 10, 4 ); function add_additional_roles( $user_id, $feed, $entry, $user_pass ) { if ( rgar( $entry, ‘form_id’ ) != 1 ) { return; } $user = new WP_User( $user_id ); $selected_role_array = explode( ‘|’, rgar( $entry, ’46’ )…Continue reading
function mp_custom_membership_info() { if (!is_user_logged_in()) { return ‘You need to be logged in to view this information.’; } global $wpdb; $user_id = get_current_user_id(); // Query to get all active MemberPress transactions for the current user $transactions = $wpdb->get_results($wpdb->prepare( “SELECT txn.*,…Continue reading
// Sets permissions for site admins to edit users function artprize_admin_users_caps( $caps, $cap, $user_id, $args ) { foreach ( $caps as $key => $capability ) { if ( $capability != ‘do_not_allow’ ) { continue; } switch ( $cap ) {…Continue reading