Duplicate Page-Post-CPT

/** * Duplicate WordPress Posts, Pages, and Custom Post Types as Drafts * * This code snippet enables the duplication of WordPress posts, pages, and all registered custom post types (CPTs). * It adds a ‘Duplicate’ link to the row…Continue reading

Intercom Messenger Hash

function add_intercom_widget() { $current_user = wp_get_current_user(); // Genereer de HMAC met de e-mail van de gebruiker $user_hash = hash_hmac( ‘sha256’, $current_user->user_email, ‘iOHXX_lxeU-bM-CWEzLKyyXhCG9NstnU0IZZls5A’ // Vervang dit door je eigen geheime sleutel ); ?>Continue reading

Add Readonly And Disabled to ACF

function add_readonly_and_disabled_to_field($field) { acf_render_field_setting($field, array( ‘label’ => __(‘Read Only?’, ‘acf’), ‘instructions’ => ”, ‘type’ => ‘radio’, ‘name’ => ‘readonly’, ‘choices’ => array( 0 => __(“No”, ‘acf’), 1 => __(“Yes”, ‘acf’), ), ‘layout’ => ‘horizontal’, )); acf_render_field_setting($field, array( ‘label’ => __(‘Disabled?’,…Continue reading

Email Template

/** * Plugin Name: Email Template * Description: Styles the all emails with HTML * Version: 1.2.3 * Author: Thomas Senecal * License: GPL-2.0+ * Text Domain: email-template **/ // ***EWL*** Apr 15, 2022 9:25:16 PM // // If this…Continue reading

Newsletter

/** * Plugin Name: Elite Web Labs Newsletters * Description: A plugin that allows for sending newsletters when publishing posts * Version: 1.0.4 * Author: Thomas Senecal * License: GPL-2.0+ * Text Domain: newsletter */ // If this file is…Continue reading

Automatically Delete Woocommerce Images After Deleting a Product

// Automatically Delete Woocommerce Images After Deleting a Product add_action( ‘before_delete_post’, ‘delete_product_images’, 10, 1 ); function delete_product_images( $post_id ) { $product = wc_get_product( $post_id ); if ( !$product ) { return; } $featured_image_id = $product->get_image_id(); $image_galleries_id = $product->get_gallery_image_ids(); if( !empty(…Continue reading