// Remove the inactive tag function mepr_remove_ck_inactive_tag_from_subscriber($txn) { $contact = $txn->user(); $enabled = (bool)get_post_meta($txn->product_id, ‘_meprconvertkit_tag_override’, true); $active_tag_id = get_post_meta($txn->product_id, ‘_meprconvertkit_tag_override_id’, true); $inactive_tag_id = get_post_meta($txn->product_id, ‘_meprconvertkit_inactive_tag_override_id’, true); $ck = new MpConvertKit(); // Remove active tag if ($enabled && !empty($active_tag_id)) { $ck->remove_tag_from_subscriber($contact,…Continue reading
add_action( ‘mepr_account_is_inactive’ , function ( $txn ) { if ( is_plugin_active( ‘buddypress/bp-loader.php’ ) && $txn instanceof MeprTransaction) { //first we need to make sure that the user isn’t active on another subscription $mepr_user = new MeprUser( $txn->user_id ); if (…Continue reading
function always_display_products($visible, $prd_id) { // Get current user object $user = get_current_user(); // Get current user’s active subscriptions $active_subs = $user->active_product_subscriptions(‘ids’); // Check if the user has a specific subscription (ID 1234) and the current product ID is 222 if…Continue reading
add_action(‘admin_init’, function() { global $wpdb; if (! isset( $_GET[‘export_subaccounts’] ) ) { return; } $corp_ids = $wpdb->get_results(“SELECT id FROM {$wpdb->prefix}mepr_corporate_accounts”); $csv_results = array(); foreach ( $corp_ids as $corp ) { // Get corp object $ca = new MPCA_Corporate_Account( $corp->id );…Continue reading
add_shortcode(‘mepr-sub-logo’, function() { global $wpdb; $logo_slug = ‘mepr_logo’; // Custom field logo slug // Get current user $user = MeprUtils::get_currentuserinfo(); $caid = get_user_meta($user->ID, ‘mpca_corporate_account_id’); if (empty($caid)) { return; // Return if no corporate account ID is found } // Get…Continue reading
add_action(‘mpca_remove_sub_account’, function($transaction_id) { $txn = new MeprTransaction($transaction_id); $user_id = $txn->user_id; // Get MeprUser object for the user $user = new MeprUser($user_id); // Get all subscriptions for the user $active_subs = $user->active_product_subscriptions(‘ids’, true); // Get active subscription IDs // Check if…Continue reading
// Schedule the event if it is not already scheduled function schedule_unattached_media_cleanup() { if (!wp_next_scheduled(‘delete_unattached_media_event’)) { wp_schedule_event(time(), ‘daily’, ‘delete_unattached_media_event’); } } add_action(‘wp’, ‘schedule_unattached_media_cleanup’); // Hook the function to the scheduled event add_action(‘delete_unattached_media_event’, ‘delete_unattached_media’); // Function to delete unattached media function…Continue reading
add_filter( ‘block_editor_settings_all’, function ( $settings, $context ) { // The default image size when added in the block editor. $settings[‘imageDefaultSize’] = ‘full’; return $settings; }, 10, 2 );Continue reading
/** * Lädt Parent Stylesheet, Child Stylesheet (optional, aber empfohlen), * Owl Carousel Styles und Owl Carousel Skript. */ add_action( ‘wp_enqueue_scripts’, ‘mein_child_theme_enqueue_styles_and_scripts’, 20 ); // Funktionsname angepasst, Priorität 20 function mein_child_theme_enqueue_styles_and_scripts() { // Lade Parent Theme Stylesheet wp_enqueue_style( ‘parent-style’, get_template_directory_uri()…Continue reading
/** * Zeigt das Elementor Template nach dem Header an. * Hängt sich an ‘mein_child_theme_after_header’ in header.php. */ add_action(‘mein_child_theme_after_header’, ‘mein_child_theme_display_after_header_content’); function mein_child_theme_display_after_header_content() { // Stelle sicher, dass die Shortcode-Funktion existiert if (function_exists(‘do_shortcode’)) { $template_id = ‘43487’; // Elementor Template ID…Continue reading